@clagentic/console 1.12.0-beta.2 → 1.12.0-beta.3
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/LICENSES/README.md +5 -0
- package/bin/cli.js +4 -2
- package/lib/agent-roster-ws.js +84 -0
- package/lib/agent-roster.js +312 -0
- package/lib/auth-required-notify.js +42 -0
- package/lib/build-sha.json +2 -2
- package/lib/build-update-notify.js +45 -0
- package/lib/build-update-offer.js +3 -4
- package/lib/build-update-standing.js +34 -14
- package/lib/cli/session-subcommands.js +26 -8
- package/lib/client-address.js +44 -0
- package/lib/daemon.js +25 -10
- package/lib/idle-compaction-setting.js +203 -0
- package/lib/mcp-bridge-credential.js +41 -0
- package/lib/notification-prefs.js +16 -22
- package/lib/notify/core.js +53 -18
- package/lib/notify/payload.js +2 -3
- package/lib/notify/type-registry.js +17 -0
- package/lib/notify/types.js +38 -1
- package/lib/outbound-access.js +12 -1
- package/lib/outbound-entry.js +8 -1
- package/lib/project-connection.js +9 -8
- package/lib/project-filesystem.js +23 -0
- package/lib/project-loop.js +16 -19
- package/lib/project-notifications.js +68 -7
- package/lib/project-sessions.js +9 -0
- package/lib/project-user-mention.js +22 -34
- package/lib/project-user-message.js +208 -4
- package/lib/project-user-shell.js +298 -0
- package/lib/project.js +26 -4
- package/lib/prompt-answer.js +145 -0
- package/lib/prompt-expiry.js +50 -0
- package/lib/prompt-registry.js +24 -1
- package/lib/prompt-source.js +16 -0
- package/lib/public/app.js +31 -2
- package/lib/public/css/agent-messages.css +96 -0
- package/lib/public/css/agent-roster.css +93 -0
- package/lib/public/css/diagnostics.css +1 -1
- package/lib/public/css/input.css +20 -141
- package/lib/public/css/login-panel.css +73 -0
- package/lib/public/css/menus.css +2 -2
- package/lib/public/css/sidebar.css +11 -0
- package/lib/public/css/team-panel.css +1 -6
- package/lib/public/css/team-view.css +101 -0
- package/lib/public/css/title-bar.css +10 -0
- package/lib/public/css/user-shell.css +144 -0
- package/lib/public/index.html +41 -7
- package/lib/public/modules/agent-avatar-picker.js +162 -0
- package/lib/public/modules/agent-avatar.js +153 -0
- package/lib/public/modules/agent-messages.js +285 -0
- package/lib/public/modules/agent-roster.js +157 -0
- package/lib/public/modules/app-connection.js +12 -0
- package/lib/public/modules/app-messages.js +55 -16
- package/lib/public/modules/app-notifications.js +59 -29
- package/lib/public/modules/app-panels.js +26 -3
- package/lib/public/modules/app-rate-limit.js +8 -165
- package/lib/public/modules/app-rendering.js +22 -7
- package/lib/public/modules/collapsible-text.js +33 -18
- package/lib/public/modules/compaction-state.js +34 -0
- package/lib/public/modules/custom-icons.js +23 -5
- package/lib/public/modules/diagnostics.js +52 -55
- package/lib/public/modules/injected-identity.js +24 -21
- package/lib/public/modules/input.js +176 -15
- package/lib/public/modules/login-panel.js +136 -0
- package/lib/public/modules/login-parser.js +73 -0
- package/lib/public/modules/login-tab.js +66 -0
- package/lib/public/modules/notifications.js +9 -1
- package/lib/public/modules/notify-client.js +114 -21
- package/lib/public/modules/pending-term-request.js +30 -0
- package/lib/public/modules/project-icon.js +22 -2
- package/lib/public/modules/queued-button.js +11 -0
- package/lib/public/modules/scheduled-input-actions.js +12 -4
- package/lib/public/modules/scheduled-outbox.js +230 -0
- package/lib/public/modules/send-now.js +200 -0
- package/lib/public/modules/server-settings.js +47 -1
- package/lib/public/modules/shell-card.js +76 -0
- package/lib/public/modules/shell-line.js +49 -0
- package/lib/public/modules/shell-queue.js +253 -0
- package/lib/public/modules/shell-settings-controls.js +76 -0
- package/lib/public/modules/sidebar-mobile.js +3 -3
- package/lib/public/modules/sidebar-sessions.js +8 -0
- package/lib/public/modules/sidebar-users.js +5 -7
- package/lib/public/modules/team-panel.js +30 -88
- package/lib/public/modules/team-view.js +211 -0
- package/lib/public/modules/terminal-links.js +18 -0
- package/lib/public/modules/terminal.js +65 -4
- package/lib/public/modules/tools.js +19 -0
- package/lib/public/modules/user-shell.js +824 -0
- package/lib/public/notify-sw-logic.js +35 -83
- package/lib/public/notify-target.js +70 -10
- package/lib/public/style.css +5 -0
- package/lib/public/sw.js +7 -3
- package/lib/queued-chat.js +392 -0
- package/lib/scheduled-input/ws.js +67 -9
- package/lib/sdk-bridge.js +122 -43
- package/lib/sdk-message-processor.js +46 -39
- package/lib/server-auth.js +6 -4
- package/lib/server-dm.js +11 -20
- package/lib/server-settings.js +39 -1
- package/lib/server.js +83 -19
- package/lib/session-directory.js +33 -8
- package/lib/session-end.js +97 -0
- package/lib/session-input-ipc.js +26 -0
- package/lib/session-input.js +176 -9
- package/lib/session-resume.js +1 -0
- package/lib/session-settings-file.js +53 -0
- package/lib/sessions.js +49 -5
- package/lib/team-traffic-ws.js +68 -0
- package/lib/team-traffic.js +318 -0
- package/lib/usage-store.js +7 -0
- package/lib/user-shell-settings.js +105 -0
- package/lib/ws-schema.js +27 -4
- package/lib/yoke/adapters/claude-capabilities.js +2 -0
- package/lib/yoke/adapters/claude-vendor.js +6 -0
- package/lib/yoke/adapters/claude-worker.js +39 -11
- package/lib/yoke/adapters/claude.js +218 -6
- package/lib/yoke/adapters/codex-capabilities.js +6 -1
- package/lib/yoke/adapters/codex-user-shell.js +265 -0
- package/lib/yoke/adapters/codex-vendor.js +7 -0
- package/lib/yoke/adapters/codex.js +186 -52
- package/lib/yoke/codex-app-server.js +8 -2
- package/lib/yoke/interface.js +54 -1
- package/lib/yoke/mcp-bridge-server.js +12 -8
- package/lib/yoke/registry.js +32 -0
- package/lib/yoke/user-shell.js +224 -0
- package/package.json +1 -1
- package/lib/public/modules/build-notice-gate.js +0 -73
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
var path = require("path");
|
|
7
7
|
var fs = require("fs");
|
|
8
8
|
var { CodexAppServer } = require("../codex-app-server");
|
|
9
|
+
var mcpBridgeCredential = require("../../mcp-bridge-credential");
|
|
9
10
|
var { discoverWorkflows } = require("../../sdk-workflow-discovery");
|
|
10
11
|
var { discoverSkillsWithMeta, collectSkillDirs } = require("../../sdk-skill-discovery");
|
|
11
12
|
var codexLocalImage = require("../codex-local-image");
|
|
@@ -13,6 +14,10 @@ var runtimeEnv = require("../../runtime-env");
|
|
|
13
14
|
var codexCapabilities = require("./codex-capabilities").codexCapabilities;
|
|
14
15
|
var codexProtocol = require("../codex-protocol");
|
|
15
16
|
var codexVersion = require("../codex-version");
|
|
17
|
+
var userShellModule = require("./codex-user-shell");
|
|
18
|
+
var createUserShellRunner = userShellModule.createUserShellRunner;
|
|
19
|
+
var refusedResult = userShellModule.refusedResult;
|
|
20
|
+
var OTHER_DIRECTORY = "Not run: this Codex session runs commands only in its own working directory.";
|
|
16
21
|
|
|
17
22
|
// --- Skill discovery ---
|
|
18
23
|
// Finds the skills of both agents: the user's and the project's .claude/skills
|
|
@@ -199,6 +204,8 @@ function flattenEvent(notification, state) {
|
|
|
199
204
|
// The app-server's own id for the turn, and the console's id for the message
|
|
200
205
|
// that started it: together they join a message to the Codex rollout.
|
|
201
206
|
var startedTurn = params.turn && params.turn.id ? params.turn.id : params.turnId;
|
|
207
|
+
// The turn a steer must name (turn/steer's expectedTurnId); cleared when it ends.
|
|
208
|
+
state.activeTurnId = startedTurn ? String(startedTurn) : null;
|
|
202
209
|
if (startedTurn && state.currentMessageId) {
|
|
203
210
|
turnStart.turnId = String(startedTurn);
|
|
204
211
|
turnStart.messageId = state.currentMessageId;
|
|
@@ -208,6 +215,7 @@ function flattenEvent(notification, state) {
|
|
|
208
215
|
}
|
|
209
216
|
|
|
210
217
|
if (method === "turn/completed") {
|
|
218
|
+
state.activeTurnId = null;
|
|
211
219
|
// lr-872f94 — schema-verified (`codex app-server generate-json-schema`,
|
|
212
220
|
// codex-cli 0.124.0): TurnCompletedNotification is { threadId, turn },
|
|
213
221
|
// and Turn carries no usage field at all. params.usage/params.status
|
|
@@ -278,6 +286,7 @@ function flattenEvent(notification, state) {
|
|
|
278
286
|
}
|
|
279
287
|
|
|
280
288
|
if (method === "turn/failed") {
|
|
289
|
+
state.activeTurnId = null;
|
|
281
290
|
events.push({
|
|
282
291
|
yokeType: "error",
|
|
283
292
|
text: params.error ? params.error.message : "Turn failed",
|
|
@@ -708,12 +717,23 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
708
717
|
// on the next approval request even though the underlying thread was
|
|
709
718
|
// started with a different approvalPolicy.
|
|
710
719
|
toolPolicy: queryOpts.toolPolicy || null,
|
|
711
|
-
//
|
|
712
|
-
//
|
|
713
|
-
//
|
|
714
|
-
|
|
720
|
+
// Temp image files belong to the input that carries them (a queued entry
|
|
721
|
+
// holds its own list). These two lists hold the files of steered inputs:
|
|
722
|
+
// a steer the app-server took lives as long as the running turn; one whose
|
|
723
|
+
// outcome is unknown is never queued again, so it lives to the loop end.
|
|
724
|
+
steeredImagePaths: [],
|
|
725
|
+
unconfirmedImagePaths: [],
|
|
715
726
|
};
|
|
716
727
|
|
|
728
|
+
// Commands the person typed (runUserShellCommand): the runner also decides,
|
|
729
|
+
// by turn id, which notifications are theirs.
|
|
730
|
+
var userShellRunner = createUserShellRunner({
|
|
731
|
+
send: function(method, params, timeoutMs) { return appServer.send(method, params, timeoutMs); },
|
|
732
|
+
isReady: function() { return !!appServer.started; },
|
|
733
|
+
threadId: function() { return state.threadId; },
|
|
734
|
+
activeTurnId: function() { return state.activeTurnId || null; },
|
|
735
|
+
});
|
|
736
|
+
|
|
717
737
|
// Internal event buffer for async iterator
|
|
718
738
|
var eventBuffer = [];
|
|
719
739
|
var eventWaiting = null;
|
|
@@ -769,7 +789,11 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
769
789
|
var messageQueueEnded = false;
|
|
770
790
|
|
|
771
791
|
function pushMessageToQueue(msg) {
|
|
772
|
-
|
|
792
|
+
// A message that can no longer run must not leave its image files behind.
|
|
793
|
+
if (messageQueueEnded || state.done) {
|
|
794
|
+
codexLocalImage.removeTempImages(msg.imagePaths || []);
|
|
795
|
+
return;
|
|
796
|
+
}
|
|
773
797
|
if (messageWaiting) {
|
|
774
798
|
var resolve = messageWaiting;
|
|
775
799
|
messageWaiting = null;
|
|
@@ -821,6 +845,10 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
821
845
|
if (cleared) cleared.abort();
|
|
822
846
|
}
|
|
823
847
|
|
|
848
|
+
// A command the person typed keeps its notifications to itself, an abort
|
|
849
|
+
// included: the abort is what settles it.
|
|
850
|
+
if (userShellRunner.consume(method, params)) return;
|
|
851
|
+
|
|
824
852
|
// After abort, only let turn-ending events through
|
|
825
853
|
if (isCancelled() && method !== "turn/completed" && method !== "turn/failed" && method !== "serverRequest/resolved" && method !== "thread/status/changed") return;
|
|
826
854
|
|
|
@@ -975,7 +1003,8 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
975
1003
|
}
|
|
976
1004
|
|
|
977
1005
|
// --- Main query loop ---
|
|
978
|
-
async function runQueryLoop(initialMessage, initialInitiator, initialMessageId) {
|
|
1006
|
+
async function runQueryLoop(initialMessage, initialInitiator, initialMessageId, initialImagePaths) {
|
|
1007
|
+
var currentImagePaths = initialImagePaths || [];
|
|
979
1008
|
// Who started the turn being sent, per turn (turn-initiator.js).
|
|
980
1009
|
var currentInitiator = initialInitiator;
|
|
981
1010
|
var currentMessageId = initialMessageId;
|
|
@@ -1163,10 +1192,10 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1163
1192
|
// lr-de04 — the app-server has finished reading any localImage temp
|
|
1164
1193
|
// files for this turn (whether it completed or failed), so they can
|
|
1165
1194
|
// be removed now rather than lingering until process exit.
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1195
|
+
codexLocalImage.removeTempImages(currentImagePaths);
|
|
1196
|
+
codexLocalImage.removeTempImages(state.steeredImagePaths);
|
|
1197
|
+
currentImagePaths = [];
|
|
1198
|
+
state.steeredImagePaths = [];
|
|
1170
1199
|
|
|
1171
1200
|
if (isCancelled()) break;
|
|
1172
1201
|
|
|
@@ -1176,6 +1205,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1176
1205
|
currentMessage = nextMsg.input;
|
|
1177
1206
|
currentInitiator = nextMsg.initiator;
|
|
1178
1207
|
currentMessageId = nextMsg.messageId;
|
|
1208
|
+
currentImagePaths = nextMsg.imagePaths || [];
|
|
1179
1209
|
}
|
|
1180
1210
|
} catch (e) {
|
|
1181
1211
|
// Suppress AbortError when the user stopped the query.
|
|
@@ -1191,11 +1221,17 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1191
1221
|
// Always deregister this query's handler so it doesn't receive stale events
|
|
1192
1222
|
// from a future query on the same app-server thread ID.
|
|
1193
1223
|
appServer.removeEventHandler(_handlerEntry);
|
|
1194
|
-
//
|
|
1195
|
-
//
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1224
|
+
// Files of a turn that never reached the cleanup above (abort or error
|
|
1225
|
+
// mid-turn), of messages still queued that will never run, and of
|
|
1226
|
+
// steers that were not confirmed.
|
|
1227
|
+
codexLocalImage.removeTempImages(currentImagePaths);
|
|
1228
|
+
codexLocalImage.removeTempImages(state.steeredImagePaths);
|
|
1229
|
+
codexLocalImage.removeTempImages(state.unconfirmedImagePaths);
|
|
1230
|
+
currentImagePaths = [];
|
|
1231
|
+
state.steeredImagePaths = [];
|
|
1232
|
+
state.unconfirmedImagePaths = [];
|
|
1233
|
+
while (messageQueue.length > 0) {
|
|
1234
|
+
codexLocalImage.removeTempImages(messageQueue.shift().imagePaths || []);
|
|
1199
1235
|
}
|
|
1200
1236
|
}
|
|
1201
1237
|
|
|
@@ -1203,6 +1239,44 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1203
1239
|
endIterator();
|
|
1204
1240
|
}
|
|
1205
1241
|
|
|
1242
|
+
// Turn input for one message: plain text, or localImage items plus the text.
|
|
1243
|
+
// An image that cannot be written is reported, never dropped silently.
|
|
1244
|
+
// Returns { input, imagePaths }: the temp files travel with the input that
|
|
1245
|
+
// references them, so each turn cleans only its own.
|
|
1246
|
+
function buildTurnInput(text, images) {
|
|
1247
|
+
var input;
|
|
1248
|
+
var imagePaths = [];
|
|
1249
|
+
if (images && images.length > 0) {
|
|
1250
|
+
input = [];
|
|
1251
|
+
var failedCount = 0;
|
|
1252
|
+
for (var i = 0; i < images.length; i++) {
|
|
1253
|
+
var img = images[i];
|
|
1254
|
+
var imgPath = codexLocalImage.writeTempImage(img.mediaType, img.data);
|
|
1255
|
+
if (imgPath) {
|
|
1256
|
+
imagePaths.push(imgPath);
|
|
1257
|
+
input.push({ type: "localImage", path: imgPath });
|
|
1258
|
+
} else {
|
|
1259
|
+
failedCount++;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
if (failedCount > 0) {
|
|
1263
|
+
// Acceptance criterion (lr-de04): an image must never be dropped
|
|
1264
|
+
// silently. Surface a visible error event so the UI shows it,
|
|
1265
|
+
// matching the shape flattenEvent already produces for turn/failed.
|
|
1266
|
+
pushEvent({
|
|
1267
|
+
yokeType: "error",
|
|
1268
|
+
text: failedCount === 1
|
|
1269
|
+
? "1 image could not be sent to Codex (failed to write temp file) and was not included in this message."
|
|
1270
|
+
: failedCount + " images could not be sent to Codex (failed to write temp file) and were not included in this message.",
|
|
1271
|
+
});
|
|
1272
|
+
}
|
|
1273
|
+
input.push({ type: "text", text: text || "" });
|
|
1274
|
+
} else {
|
|
1275
|
+
input = text || "";
|
|
1276
|
+
}
|
|
1277
|
+
return { input: input, imagePaths: imagePaths };
|
|
1278
|
+
}
|
|
1279
|
+
|
|
1206
1280
|
var handle = {
|
|
1207
1281
|
[Symbol.asyncIterator]: function() {
|
|
1208
1282
|
return {
|
|
@@ -1219,44 +1293,58 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1219
1293
|
},
|
|
1220
1294
|
|
|
1221
1295
|
pushMessage: function(text, images, initiator, messageId) {
|
|
1222
|
-
var
|
|
1223
|
-
if (images && images.length > 0) {
|
|
1224
|
-
input = [];
|
|
1225
|
-
var failedCount = 0;
|
|
1226
|
-
for (var i = 0; i < images.length; i++) {
|
|
1227
|
-
var img = images[i];
|
|
1228
|
-
var imgPath = codexLocalImage.writeTempImage(img.mediaType, img.data);
|
|
1229
|
-
if (imgPath) {
|
|
1230
|
-
state.pendingImagePaths.push(imgPath);
|
|
1231
|
-
input.push({ type: "localImage", path: imgPath });
|
|
1232
|
-
} else {
|
|
1233
|
-
failedCount++;
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
if (failedCount > 0) {
|
|
1237
|
-
// Acceptance criterion (lr-de04): an image must never be dropped
|
|
1238
|
-
// silently. Surface a visible error event so the UI shows it,
|
|
1239
|
-
// matching the shape flattenEvent already produces for turn/failed.
|
|
1240
|
-
pushEvent({
|
|
1241
|
-
yokeType: "error",
|
|
1242
|
-
text: failedCount === 1
|
|
1243
|
-
? "1 image could not be sent to Codex (failed to write temp file) and was not included in this message."
|
|
1244
|
-
: failedCount + " images could not be sent to Codex (failed to write temp file) and were not included in this message.",
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
input.push({ type: "text", text: text || "" });
|
|
1248
|
-
} else {
|
|
1249
|
-
input = text || "";
|
|
1250
|
-
}
|
|
1296
|
+
var built = buildTurnInput(text, images);
|
|
1251
1297
|
|
|
1252
1298
|
if (!state.loopStarted) {
|
|
1253
1299
|
state.loopStarted = true;
|
|
1254
|
-
runQueryLoop(input, initiator, messageId);
|
|
1300
|
+
runQueryLoop(built.input, initiator, messageId, built.imagePaths);
|
|
1255
1301
|
} else {
|
|
1256
|
-
pushMessageToQueue({ input: input, initiator: initiator, messageId: messageId });
|
|
1302
|
+
pushMessageToQueue({ input: built.input, imagePaths: built.imagePaths, initiator: initiator, messageId: messageId });
|
|
1257
1303
|
}
|
|
1258
1304
|
},
|
|
1259
1305
|
|
|
1306
|
+
// Delivers a message into the turn that is running (turn/steer). Resolves
|
|
1307
|
+
// { steered: true } when the app-server took it. When no turn is running, or
|
|
1308
|
+
// the turn ended before the steer landed (expectedTurnId no longer matches,
|
|
1309
|
+
// or any other refusal), the message goes to the queue for the next turn and
|
|
1310
|
+
// resolves { steered: false, reason }: it is never dropped. A transport
|
|
1311
|
+
// failure (timeout, dead process) is different: the server may have taken the
|
|
1312
|
+
// message, so it is NOT queued again (that could run a second turn); it
|
|
1313
|
+
// resolves { steered: false, reason: "unconfirmed" } and the caller tells the
|
|
1314
|
+
// user.
|
|
1315
|
+
steerMessage: function(text, images, initiator, messageId) {
|
|
1316
|
+
var turnId = state.activeTurnId;
|
|
1317
|
+
if (!state.loopStarted || !turnId || !state.threadId) {
|
|
1318
|
+
handle.pushMessage(text, images, initiator, messageId);
|
|
1319
|
+
return Promise.resolve({ steered: false, reason: "no-running-turn" });
|
|
1320
|
+
}
|
|
1321
|
+
// Built once: a refused steer queues this same prepared input, so temp
|
|
1322
|
+
// image files are written a single time and none is dropped on the retry.
|
|
1323
|
+
var built = buildTurnInput(text, images);
|
|
1324
|
+
var prepared = built.input;
|
|
1325
|
+
var input = typeof prepared === "string" ? [{ type: "text", text: prepared }] : prepared;
|
|
1326
|
+
var params = { threadId: state.threadId, expectedTurnId: turnId, input: input };
|
|
1327
|
+
if (typeof messageId === "string" && messageId) params.clientUserMessageId = messageId;
|
|
1328
|
+
// The response can arrive after runQueryLoop's finally has drained the
|
|
1329
|
+
// per-loop path lists; nothing drains them again, so a settle that finds
|
|
1330
|
+
// the loop done removes its files itself.
|
|
1331
|
+
return appServer.send("turn/steer", params, 10000).then(function() {
|
|
1332
|
+
if (state.done) codexLocalImage.removeTempImages(built.imagePaths);
|
|
1333
|
+
else state.steeredImagePaths = state.steeredImagePaths.concat(built.imagePaths);
|
|
1334
|
+
return { steered: true };
|
|
1335
|
+
}, function(err) {
|
|
1336
|
+
if (!err || typeof err.rpcCode !== "number") {
|
|
1337
|
+
console.warn("[yoke/codex] turn/steer outcome unknown, not queueing again: " + (err && err.message || err));
|
|
1338
|
+
if (state.done) codexLocalImage.removeTempImages(built.imagePaths);
|
|
1339
|
+
else state.unconfirmedImagePaths = state.unconfirmedImagePaths.concat(built.imagePaths);
|
|
1340
|
+
return { steered: false, reason: "unconfirmed" };
|
|
1341
|
+
}
|
|
1342
|
+
console.warn("[yoke/codex] turn/steer refused, queueing for the next turn: " + (err && err.message || err));
|
|
1343
|
+
pushMessageToQueue({ input: prepared, imagePaths: built.imagePaths, initiator: initiator, messageId: messageId });
|
|
1344
|
+
return { steered: false, reason: "turn-ended" };
|
|
1345
|
+
});
|
|
1346
|
+
},
|
|
1347
|
+
|
|
1260
1348
|
setModel: function(model) {
|
|
1261
1349
|
// lr-79ee — genuinely live: turn/start (see runQueryLoop above) sends
|
|
1262
1350
|
// state.model on every turn, so this takes effect starting with the
|
|
@@ -1305,9 +1393,24 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1305
1393
|
return Promise.resolve(null);
|
|
1306
1394
|
},
|
|
1307
1395
|
|
|
1396
|
+
// Runs a command the person typed, on the thread, through the app-server's
|
|
1397
|
+
// thread/shellCommand with the console's timeout. thread/shellCommand runs
|
|
1398
|
+
// where the thread runs and takes no directory, so a command asked for in
|
|
1399
|
+
// any other directory is refused with a result that says why; it is never run
|
|
1400
|
+
// elsewhere and the directory is never ignored. runOpts.signal interrupts it.
|
|
1401
|
+
// Resolves with the result (YOKE interface 0.6.0); rejects when the
|
|
1402
|
+
// app-server refuses the request.
|
|
1403
|
+
runUserShellCommand: function(command, cwd, timeoutMs, maxOutputBytes, runOpts) {
|
|
1404
|
+
var signal = runOpts && runOpts.signal;
|
|
1405
|
+
var elsewhere = cwd && (!queryOpts.cwd || path.resolve(cwd) !== path.resolve(queryOpts.cwd));
|
|
1406
|
+
if (elsewhere) return Promise.resolve(refusedResult(OTHER_DIRECTORY));
|
|
1407
|
+
return userShellRunner.run(command, timeoutMs, maxOutputBytes, signal);
|
|
1408
|
+
},
|
|
1409
|
+
|
|
1308
1410
|
abort: function() {
|
|
1309
1411
|
console.log("[yoke/codex] handle.abort() called, threadId=" + state.threadId + " already aborted=" + state.aborted);
|
|
1310
1412
|
state.aborted = true;
|
|
1413
|
+
userShellRunner.interruptRunning();
|
|
1311
1414
|
// Send turn/interrupt to stop the server-side turn
|
|
1312
1415
|
if (state.threadId && appServer.started) {
|
|
1313
1416
|
appServer.send("turn/interrupt", { threadId: state.threadId }, 5000).catch(function() {});
|
|
@@ -1324,6 +1427,7 @@ function createCodexQueryHandle(appServer, queryOpts) {
|
|
|
1324
1427
|
},
|
|
1325
1428
|
|
|
1326
1429
|
close: function() {
|
|
1430
|
+
userShellRunner.interruptRunning();
|
|
1327
1431
|
messageQueueEnded = true;
|
|
1328
1432
|
if (messageWaiting) {
|
|
1329
1433
|
var resolve = messageWaiting;
|
|
@@ -1443,6 +1547,26 @@ function mergeConfig(base, over) {
|
|
|
1443
1547
|
// reports, else what the binary reported when it was resolved. initialize has
|
|
1444
1548
|
// no version field of its own, so a userAgent that cannot be read is no reason
|
|
1445
1549
|
// to refuse a server whose binary reported one.
|
|
1550
|
+
// Whether the running app-server has turn/steer, found by calling it with ids
|
|
1551
|
+
// that name nothing. A server that has the method answers with a refusal about
|
|
1552
|
+
// the thread; one that lacks it answers with JSON-RPC -32601. Any other
|
|
1553
|
+
// outcome (a timeout, a dead process) proves nothing, so steering stays off.
|
|
1554
|
+
async function probeTurnSteer(server) {
|
|
1555
|
+
try {
|
|
1556
|
+
await server.send("turn/steer", {
|
|
1557
|
+
threadId: "00000000-0000-0000-0000-000000000000",
|
|
1558
|
+
expectedTurnId: "probe",
|
|
1559
|
+
input: [{ type: "text", text: "" }],
|
|
1560
|
+
}, 8000);
|
|
1561
|
+
return true;
|
|
1562
|
+
} catch (e) {
|
|
1563
|
+
// Only a structured JSON-RPC refusal proves the server parsed the call:
|
|
1564
|
+
// -32601 is "method not found", any other code is a refusal of this call.
|
|
1565
|
+
if (!e || typeof e.rpcCode !== "number") return false;
|
|
1566
|
+
return e.rpcCode !== -32601;
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1569
|
+
|
|
1446
1570
|
function settleRunningVersion(binaryVersion, initializeResult) {
|
|
1447
1571
|
var reported = codexVersion.versionFromUserAgent(initializeResult && initializeResult.userAgent);
|
|
1448
1572
|
var binary = codexVersion.parseVersion(typeof binaryVersion === "string" ? binaryVersion : "");
|
|
@@ -1610,7 +1734,7 @@ function createCodexAdapter(opts) {
|
|
|
1610
1734
|
skills: skillNames || [],
|
|
1611
1735
|
slashCommands: buildEnrichedSlashCommands(skillNames, cwd, homeOverride),
|
|
1612
1736
|
fastModeState: null,
|
|
1613
|
-
capabilities: codexCapabilities(),
|
|
1737
|
+
capabilities: Object.assign(codexCapabilities(), { steering: inst.steer === true }),
|
|
1614
1738
|
};
|
|
1615
1739
|
}
|
|
1616
1740
|
|
|
@@ -1847,18 +1971,26 @@ function createCodexAdapter(opts) {
|
|
|
1847
1971
|
var bridgePath = require("path").join(__dirname, "..", "mcp-bridge-server.js");
|
|
1848
1972
|
var clayPort = effectiveInitOpts.clayPort || process.env.CLAY_PORT || 2633;
|
|
1849
1973
|
var clayTls = effectiveInitOpts.clayTls || false;
|
|
1850
|
-
var clayAuthToken = effectiveInitOpts.clayAuthToken || "";
|
|
1851
1974
|
var claySlug = effectiveInitOpts.slug || _slug || "";
|
|
1852
1975
|
try {
|
|
1853
|
-
|
|
1976
|
+
// The daemon serves the bridge only under /p/{slug}, so without a
|
|
1977
|
+
// slug there is nothing for the bridge to reach and no credential
|
|
1978
|
+
// to issue.
|
|
1979
|
+
if (claySlug && require("fs").existsSync(bridgePath)) {
|
|
1854
1980
|
var bridgeArgs = [bridgePath, "--port", String(clayPort), "--slug", claySlug];
|
|
1855
1981
|
if (clayTls) bridgeArgs.push("--tls");
|
|
1856
|
-
|
|
1857
|
-
|
|
1982
|
+
// mcp_servers config is serialized into --config argv of the
|
|
1983
|
+
// app-server process (and logged), so the credential must not
|
|
1984
|
+
// travel in it. It rides in the app-server's own environment
|
|
1985
|
+
// (secretEnv) and the config names the variable, which Codex
|
|
1986
|
+
// forwards to the bridge child.
|
|
1858
1987
|
mcpServerConfig["clay-tools"] = {
|
|
1859
1988
|
command: process.execPath,
|
|
1860
1989
|
args: bridgeArgs,
|
|
1861
|
-
|
|
1990
|
+
env_vars: [mcpBridgeCredential.ENV_NAME],
|
|
1991
|
+
};
|
|
1992
|
+
serverOpts.secretEnv = {
|
|
1993
|
+
[mcpBridgeCredential.ENV_NAME]: mcpBridgeCredential.credentialFor(claySlug),
|
|
1862
1994
|
};
|
|
1863
1995
|
}
|
|
1864
1996
|
} catch (e) {
|
|
@@ -1902,6 +2034,7 @@ function createCodexAdapter(opts) {
|
|
|
1902
2034
|
throw codexError("CODEX_TOO_OLD", "Codex " + running.text + " is too old; Clagentic: Console needs " + codexVersion.MIN_CODEX_VERSION + " or newer");
|
|
1903
2035
|
}
|
|
1904
2036
|
inst.version = running ? running.text : null;
|
|
2037
|
+
inst.steer = await probeTurnSteer(server);
|
|
1905
2038
|
inst.features = codexProtocol.protocolFeatures(running);
|
|
1906
2039
|
if (JSON.stringify(inst.features) !== JSON.stringify(spawnFeatures)) {
|
|
1907
2040
|
console.warn("[codex] the running app-server (" + inst.version + ") differs from the binary that was resolved (" + binaryVersion + "); its config was set for the binary");
|
|
@@ -2199,4 +2332,5 @@ module.exports = {
|
|
|
2199
2332
|
// indirectly through a full query/init round trip.
|
|
2200
2333
|
_test_discoverClaudeSkills: discoverSkillFiles,
|
|
2201
2334
|
_test_mergeConfig: mergeConfig,
|
|
2335
|
+
_test_probeTurnSteer: probeTurnSteer,
|
|
2202
2336
|
};
|
|
@@ -60,6 +60,7 @@ function toTomlValue(val) {
|
|
|
60
60
|
//
|
|
61
61
|
// opts: { cwd, env, config }
|
|
62
62
|
// env the environment laid over the daemon's own
|
|
63
|
+
// secretEnv variables laid over that last, for values that must stay out of config
|
|
63
64
|
function CodexAppServer(executablePath, opts) {
|
|
64
65
|
this.proc = null;
|
|
65
66
|
this.rl = null;
|
|
@@ -88,7 +89,8 @@ CodexAppServer.prototype.start = function() {
|
|
|
88
89
|
return new Promise(function(resolve, reject) {
|
|
89
90
|
try {
|
|
90
91
|
var args = ["app-server"];
|
|
91
|
-
|
|
92
|
+
// secretEnv is laid last and never reaches argv or the log line below.
|
|
93
|
+
var env = Object.assign({}, process.env, self.opts.env || {}, self.opts.secretEnv || {});
|
|
92
94
|
|
|
93
95
|
// Pass config overrides via --config key=value flags
|
|
94
96
|
if (self.opts.config) {
|
|
@@ -170,7 +172,11 @@ CodexAppServer.prototype._handleMessage = function(msg) {
|
|
|
170
172
|
delete this.pendingRequests[msg.id];
|
|
171
173
|
if (pending.timer) clearTimeout(pending.timer);
|
|
172
174
|
if (msg.error) {
|
|
173
|
-
|
|
175
|
+
// The numeric JSON-RPC code rides on the error so a caller can tell a
|
|
176
|
+
// server's explicit refusal from a transport failure (which has none).
|
|
177
|
+
var rpcErr = new Error(msg.error.message || JSON.stringify(msg.error));
|
|
178
|
+
if (typeof msg.error.code === "number") rpcErr.rpcCode = msg.error.code;
|
|
179
|
+
pending.reject(rpcErr);
|
|
174
180
|
} else {
|
|
175
181
|
pending.resolve(msg.result);
|
|
176
182
|
}
|
package/lib/yoke/interface.js
CHANGED
|
@@ -38,6 +38,26 @@
|
|
|
38
38
|
// ignores it.
|
|
39
39
|
// Removed: the attestsHumanSessions trait. Provenance is per turn and carried
|
|
40
40
|
// by the turn itself, not declared per adapter.
|
|
41
|
+
//
|
|
42
|
+
// 0.5.0 → 0.6.0 (2026-11, additive)
|
|
43
|
+
// Added: QueryHandle.runUserShellCommand(command, cwd, timeoutMs,
|
|
44
|
+
// maxOutputBytes, { signal }), an optional method for a shell command the
|
|
45
|
+
// person typed for themselves. It resolves with { exitCode, durationMs,
|
|
46
|
+
// output, truncated, timedOut, interrupted }, and the command ends up in the
|
|
47
|
+
// agent's conversation without a model turn. Nothing else changes: an adapter
|
|
48
|
+
// without the method is detectable (typeof handle.runUserShellCommand !==
|
|
49
|
+
// "function") and is simply offered no such command, so no existing adapter or
|
|
50
|
+
// caller has to change.
|
|
51
|
+
// Migration for an adapter author: implement the method only if the agent can
|
|
52
|
+
// record a user-run command without answering it. An adapter may refuse a cwd
|
|
53
|
+
// it cannot honour; the refusal is a resolved result (exitCode null, output
|
|
54
|
+
// naming the reason), never a throw, and the command is not run elsewhere.
|
|
55
|
+
// Honour signal by stopping
|
|
56
|
+
// the command, and report interrupted: true only once it has stopped. Cut the
|
|
57
|
+
// output at maxOutputBytes on a character boundary, counting any failure text
|
|
58
|
+
// you add. Never run the command as another user than the console process.
|
|
59
|
+
// In an adapter that identifies a command's notifications by turn id, match
|
|
60
|
+
// every one of them (start, items, end, late end) on that id.
|
|
41
61
|
|
|
42
62
|
/**
|
|
43
63
|
* YOKE contract version. Bumped on every additive or breaking change.
|
|
@@ -51,8 +71,9 @@
|
|
|
51
71
|
* 0.3.0 — capability ledger, vendor registry, reconciled method lists
|
|
52
72
|
* 0.4.0 — adapter traits split out of the capability ledger
|
|
53
73
|
* 0.5.0 — per-turn initiator on pushMessage; attestsHumanSessions removed
|
|
74
|
+
* 0.6.0 — optional QueryHandle.runUserShellCommand
|
|
54
75
|
*/
|
|
55
|
-
var INTERFACE_VERSION = "0.
|
|
76
|
+
var INTERFACE_VERSION = "0.6.0";
|
|
56
77
|
|
|
57
78
|
var TOOL_POLICIES = ["ask", "allow-all"];
|
|
58
79
|
|
|
@@ -134,10 +155,40 @@ var QUERY_HANDLE_METHODS = [
|
|
|
134
155
|
* (or the method) first; absence is not an error.
|
|
135
156
|
* .setPermissionMode(mode) - capability permissionModes
|
|
136
157
|
* .rewindFiles(uuid, opts) - capability rewind
|
|
158
|
+
* .cancelQueuedMessage(messageId) - capability queuedMessageCancel (the caller
|
|
159
|
+
* checks the capability, not the list above); withdraws
|
|
160
|
+
* a message pushed with that messageId that the
|
|
161
|
+
* agent has not yet taken into a turn. Resolves
|
|
162
|
+
* true when it was withdrawn (it will never be
|
|
163
|
+
* delivered) and false when it was already taken
|
|
164
|
+
* or is unknown; rejects when the agent cannot say.
|
|
165
|
+
* .interruptKeepingQueued() - capability queuedMessageCancel; interrupts the
|
|
166
|
+
* running turn and keeps every message already
|
|
167
|
+
* pushed, so a queued one runs as the next input at
|
|
168
|
+
* once. Resolves { stillQueued }: the message ids the
|
|
169
|
+
* agent still holds after the interrupt (they run),
|
|
170
|
+
* or null when the agent gave no receipt; rejects when
|
|
171
|
+
* the agent cannot interrupt.
|
|
172
|
+
* .runUserShellCommand(command, cwd, timeoutMs, maxOutputBytes, { signal })
|
|
173
|
+
* - runs a shell command the person typed for
|
|
174
|
+
* themselves, kills it at timeoutMs, keeps at most
|
|
175
|
+
* maxOutputBytes of its output (cut on a character
|
|
176
|
+
* boundary; the result says when it cut) and puts it
|
|
177
|
+
* in the conversation with no model turn. signal (an
|
|
178
|
+
* AbortSignal) interrupts it. Resolves { exitCode,
|
|
179
|
+
* durationMs, output, truncated, timedOut,
|
|
180
|
+
* interrupted }; interrupted is true only once the
|
|
181
|
+
* command has stopped. An adapter may refuse a cwd it
|
|
182
|
+
* cannot honour: the refusal is a result whose output
|
|
183
|
+
* names the reason, not a throw. The caller has already passed
|
|
184
|
+
* whatever gate applies; the method never asks.
|
|
185
|
+
* Absent where the agent cannot take it (the
|
|
186
|
+
* OS-user worker handle): test for the method.
|
|
137
187
|
*/
|
|
138
188
|
var QUERY_HANDLE_OPTIONAL_METHODS = [
|
|
139
189
|
"setPermissionMode",
|
|
140
190
|
"rewindFiles",
|
|
191
|
+
"runUserShellCommand",
|
|
141
192
|
];
|
|
142
193
|
|
|
143
194
|
/**
|
|
@@ -195,9 +246,11 @@ var CAPABILITIES = {
|
|
|
195
246
|
backgroundTasks: { kind: "flag", reason: "This agent has no background tasks." },
|
|
196
247
|
steering: { kind: "flag", reason: "This agent cannot take a message while it is working." },
|
|
197
248
|
agentInjection: { kind: "flag", reason: "This agent cannot take on a named agent identity." },
|
|
249
|
+
queuedMessageCancel: { kind: "flag", reason: "This agent cannot withdraw a message that is waiting to be delivered." },
|
|
198
250
|
executionPolicy: { kind: "flag", reason: "This agent has no approval, sandbox or web search settings." },
|
|
199
251
|
toolPolicy: { kind: "list", reason: "This agent has no tool approval policy." },
|
|
200
252
|
permissionModes: { kind: "list", reason: "This agent has no permission modes." },
|
|
253
|
+
additiveSettings: { kind: "flag", reason: "This agent cannot take an extra settings file for a session." },
|
|
201
254
|
};
|
|
202
255
|
|
|
203
256
|
var CAPABILITY_KEYS = Object.keys(CAPABILITIES);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// Codex spawns this as a native MCP server via config.mcp_servers["clay-tools"].
|
|
5
5
|
// It implements the MCP protocol on stdio (JSON-RPC) and proxies tool
|
|
6
6
|
// list/call requests to the project-scoped HTTP endpoint
|
|
7
|
-
// (/p/{slug}/api/mcp-bridge)
|
|
7
|
+
// (/p/{slug}/api/mcp-bridge). A slug is required.
|
|
8
8
|
//
|
|
9
9
|
// Usage: node mcp-bridge-server.js --port 2633 --slug my-project
|
|
10
10
|
//
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
var http = require("http");
|
|
20
20
|
var https = require("https");
|
|
21
|
+
var bridgeCredential = require("../mcp-bridge-credential");
|
|
21
22
|
|
|
22
23
|
// --- Parse CLI args ---
|
|
23
24
|
var args = process.argv.slice(2);
|
|
@@ -37,14 +38,18 @@ for (var i = 0; i < args.length; i++) {
|
|
|
37
38
|
}
|
|
38
39
|
}
|
|
39
40
|
|
|
41
|
+
if (!claySlug) {
|
|
42
|
+
process.stderr.write("mcp-bridge-server: --slug is required\n");
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
45
|
+
|
|
40
46
|
var CLAY_PROTOCOL = clayTls ? "https" : "http";
|
|
41
47
|
var CLAY_BASE_URL = CLAY_PROTOCOL + "://127.0.0.1:" + clayPort;
|
|
42
|
-
var CLAY_MCP_PATH = claySlug
|
|
43
|
-
? ("/p/" + claySlug + "/api/mcp-bridge")
|
|
44
|
-
: "/api/mcp-bridge";
|
|
48
|
+
var CLAY_MCP_PATH = "/p/" + claySlug + "/api/mcp-bridge";
|
|
45
49
|
|
|
46
50
|
// --- Auth ---
|
|
47
|
-
|
|
51
|
+
// The per-project bridge credential, handed over in the environment only.
|
|
52
|
+
var bridgeToken = process.env[bridgeCredential.ENV_NAME] || "";
|
|
48
53
|
|
|
49
54
|
// --- Tool cache ---
|
|
50
55
|
var _tools = []; // [{ server, name, description, inputSchema }]
|
|
@@ -62,9 +67,8 @@ function postJson(urlPath, body) {
|
|
|
62
67
|
"Content-Type": "application/json",
|
|
63
68
|
"Content-Length": Buffer.byteLength(data),
|
|
64
69
|
};
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
headers["Cookie"] = "relay_auth=" + clayAuthToken;
|
|
70
|
+
if (bridgeToken) {
|
|
71
|
+
headers[bridgeCredential.HEADER_NAME] = bridgeToken;
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
var reqOpts = {
|
package/lib/yoke/registry.js
CHANGED
|
@@ -48,6 +48,28 @@ function requireStringList(descriptor, field) {
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
+
var LOGIN_PATTERN_KEYS = ["url", "codePrompt", "userCode"];
|
|
52
|
+
|
|
53
|
+
// Each pattern must compile, because the browser compiles it and a bad one
|
|
54
|
+
// would otherwise only show as a panel that never appears.
|
|
55
|
+
function requireLoginPatterns(descriptor) {
|
|
56
|
+
var patterns = descriptor.loginPatterns;
|
|
57
|
+
var fail = function (why) {
|
|
58
|
+
throw new Error("[YOKE] Vendor descriptor '" + descriptor.id + "' loginPatterns " + why);
|
|
59
|
+
};
|
|
60
|
+
if (!patterns || typeof patterns !== "object") fail("must be an object");
|
|
61
|
+
if (typeof patterns.url !== "string" || !patterns.url) fail("needs a non-empty 'url' pattern");
|
|
62
|
+
Object.keys(patterns).forEach(function (key) {
|
|
63
|
+
if (LOGIN_PATTERN_KEYS.indexOf(key) === -1) fail("has an unknown key: " + key);
|
|
64
|
+
if (typeof patterns[key] !== "string" || !patterns[key]) fail("'" + key + "' must be a non-empty string");
|
|
65
|
+
try {
|
|
66
|
+
new RegExp(patterns[key]);
|
|
67
|
+
} catch (e) {
|
|
68
|
+
fail("'" + key + "' is not a valid regular expression");
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
|
|
51
73
|
/** Whether the descriptor owns a variable name, by exact name or by prefix. */
|
|
52
74
|
function descriptorOwns(descriptor, name) {
|
|
53
75
|
return envOwnership.owns({ names: descriptor.ownedEnvNames, prefixes: descriptor.ownedEnvPrefixes }, name);
|
|
@@ -109,6 +131,14 @@ function validateCredentialGroups(descriptor) {
|
|
|
109
131
|
* osUsers is true under os-users mode
|
|
110
132
|
* installHint string one line telling the user how to install it
|
|
111
133
|
* loginCommand string the one place the login command is written
|
|
134
|
+
* loginPatterns optional {url, codePrompt?, userCode?} regular expression
|
|
135
|
+
* sources (no flags) the browser applies to the login
|
|
136
|
+
* terminal's own output, so it can offer the sign-in link and
|
|
137
|
+
* code entry. url matches the sign-in URL; codePrompt matches
|
|
138
|
+
* the line asking the user to paste a code; userCode has one
|
|
139
|
+
* capture group, the code the agent displays for the user to
|
|
140
|
+
* enter on the sign-in page. Lines are joined with a newline
|
|
141
|
+
* after hard-wrapped URLs are rejoined. Absent: no sign-in panel
|
|
112
142
|
* osUsersSupported boolean can run under per-user OS isolation; when false the
|
|
113
143
|
* agent is disabled, with a reason, in that mode
|
|
114
144
|
* needsRuntimeEnv boolean every entry point requires runtimeEnv
|
|
@@ -160,6 +190,7 @@ function register(descriptor) {
|
|
|
160
190
|
if (descriptor.effectiveRuntimeEnv !== undefined) requireFunction(descriptor, "effectiveRuntimeEnv");
|
|
161
191
|
requireBoolean(descriptor, "osUsersSupported");
|
|
162
192
|
requireBoolean(descriptor, "needsRuntimeEnv");
|
|
193
|
+
if (descriptor.loginPatterns !== undefined) requireLoginPatterns(descriptor);
|
|
163
194
|
if (descriptor.capabilityReasons === undefined) descriptor = Object.assign({}, descriptor, { capabilityReasons: {} });
|
|
164
195
|
Object.keys(descriptor.capabilityReasons).forEach(function (key) {
|
|
165
196
|
if (!iface.isCapabilityKey(key) || typeof descriptor.capabilityReasons[key] !== "string" || !descriptor.capabilityReasons[key]) {
|
|
@@ -328,6 +359,7 @@ function describeForClient(state) {
|
|
|
328
359
|
icon: d.icon,
|
|
329
360
|
installHint: d.installHint,
|
|
330
361
|
loginCommand: d.loginCommand,
|
|
362
|
+
loginPatterns: d.loginPatterns ? Object.assign({}, d.loginPatterns) : null,
|
|
331
363
|
osUsersSupported: d.osUsersSupported,
|
|
332
364
|
installed: installed.indexOf(d.id) !== -1,
|
|
333
365
|
probeFailure: Object.prototype.hasOwnProperty.call(failures, d.id) ? failures[d.id] : null,
|