@moxt-ai/mobius 0.0.50 → 0.0.52
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/dist/acp/session-config/grok-build-session-config.d.ts.map +1 -1
- package/dist/acp/session-config/grok-build-session-config.js +2 -2
- package/dist/acp/session-config/grok-build-session-config.js.map +1 -1
- package/dist/acp/session-config/session-config-protocol.d.ts +0 -2
- package/dist/acp/session-config/session-config-protocol.d.ts.map +1 -1
- package/dist/acp/session-config/session-config-protocol.js +8 -107
- package/dist/acp/session-config/session-config-protocol.js.map +1 -1
- package/dist/acp/session-manager.d.ts +2 -0
- package/dist/acp/session-manager.d.ts.map +1 -1
- package/dist/acp/session-manager.js +28 -43
- package/dist/acp/session-manager.js.map +1 -1
- package/dist/agent-catalog/agent-settings-adapter.d.ts +22 -0
- package/dist/agent-catalog/agent-settings-adapter.d.ts.map +1 -0
- package/dist/agent-catalog/agent-settings-adapter.js +191 -0
- package/dist/agent-catalog/agent-settings-adapter.js.map +1 -0
- package/dist/agent-catalog/local-agent.d.ts +2 -4
- package/dist/agent-catalog/local-agent.d.ts.map +1 -1
- package/dist/agent-catalog/local-agent.js +3 -12
- package/dist/agent-catalog/local-agent.js.map +1 -1
- package/dist/cli.js +22730 -22714
- package/dist/cli.js.map +4 -4
- package/dist/index.js +496 -482
- package/dist/index.js.map +4 -4
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +162 -45
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +22654 -22638
- package/dist/runtime.js.map +4 -4
- package/package.json +1 -1
- package/dist/agent-catalog/agent-permission-profile.d.ts +0 -16
- package/dist/agent-catalog/agent-permission-profile.d.ts.map +0 -1
- package/dist/agent-catalog/agent-permission-profile.js +0 -194
- package/dist/agent-catalog/agent-permission-profile.js.map +0 -1
package/dist/run-daemon.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-daemon.d.ts","sourceRoot":"","sources":["../src/run-daemon.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-daemon.d.ts","sourceRoot":"","sources":["../src/run-daemon.ts"],"names":[],"mappings":"AAgJA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUhD,OAAO,EAA4B,KAAK,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AA6/E5G,wBAAsB,SAAS,CAC3B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,KAAK,GAAE,WAA+B,GACvC,OAAO,CAAC,IAAI,CAAC,CAoJf"}
|
package/dist/run-daemon.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { randomUUID } from "node:crypto";
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
2
|
import { basename } from "node:path";
|
|
3
3
|
import { styleText } from "node:util";
|
|
4
|
-
import { AGENT_ACTIVITY_KIND, AGENT_INSTALL_CANCEL_KIND, AGENT_INSTALL_CANCELLED_KIND, AGENT_INSTALL_COMPLETED_KIND, AGENT_INSTALL_FAILED_KIND, AGENT_INSTALL_PROGRESS_KIND, AGENT_INSTALL_REQUEST_KIND, AGENT_INSTALL_STARTED_KIND, AGENT_MESSAGE_DELTA_KIND,
|
|
4
|
+
import { AGENT_ACTIVITY_KIND, AGENT_INSTALL_CANCEL_KIND, AGENT_INSTALL_CANCELLED_KIND, AGENT_INSTALL_COMPLETED_KIND, AGENT_INSTALL_FAILED_KIND, AGENT_INSTALL_PROGRESS_KIND, AGENT_INSTALL_REQUEST_KIND, AGENT_INSTALL_STARTED_KIND, AGENT_MESSAGE_DELTA_KIND, AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE, AGENT_MODEL_EFFORT_RESOLUTION_ON_MODEL_SELECTION, AGENT_MODEL_EFFORT_RESOLUTION_UNAVAILABLE, AGENT_SETTINGS_DISCOVER_KIND, AGENT_SETTINGS_DISCOVERED_KIND, AGENT_SETTINGS_DISCOVERY_FAILED_KIND, decodeAgentInstallCancelCommand, decodeAgentInstallRequestCommand, decodeAgentSettingsDiscoverCommand, decodeFileReadCommand, decodeMessageKind, decodeNativeSessionCancel, decodeNativeSessionCommand, decodeNativeSessionTurnForkCommand, decodeRuntimeDelivery, decodeRuntimeDeliveryCommitted, decodeRuntimeHeartbeatAckEvent, decodeRuntimeLivenessReadyEvent, decodeSessionCancelCommand, decodeSessionConfigureCommand, decodeSessionElicitationRespondCommand, decodeSessionEventAcknowledgement, decodeSessionEventDeferred, decodeSessionEventEnvelope, decodeSessionEventRejection, decodeSessionPermissionRespondCommand, decodeSessionPrepareCommand, decodeSessionPromptCommand, decodeWorkspaceListCommand, encodeAgentActivityEvent, encodeAgentContentEvent, encodeAgentInstallCancelledEvent, encodeAgentInstallCompletedEvent, encodeAgentInstallFailedEvent, encodeAgentInstallProgressEvent, encodeAgentInstallStartedEvent, encodeAgentMessageDeltaEvent, encodeAgentSettingsDiscoveredEvent, encodeAgentSettingsDiscoveryFailedEvent, encodeFileFailedEvent, encodeNativeSessionResult, encodeRuntimeDeliveryReceived, encodeSessionCommandsUpdatedEvent, encodeSessionCompletedEvent, encodeSessionConfigUpdatedEvent, encodeSessionElicitationRequestedEvent, encodeSessionElicitationResolvedEvent, encodeSessionFailedEvent, encodeSessionInfoUpdatedEvent, encodeSessionOperationFailedEvent, encodeSessionPermissionRequestedEvent, encodeSessionPermissionResolvedEvent, encodeSessionReadyEvent, encodeSessionStartedEvent, encodeSessionUsageUpdatedEvent, encodeWorkspaceEntriesEvent, FILE_FAILED_KIND, FILE_READ_KIND, NATIVE_SESSION_CANCEL_KIND, NATIVE_SESSION_REQUEST_KIND, NATIVE_SESSION_TURN_FORK_KIND, RUNTIME_DELIVERY_COMMITTED_KIND, RUNTIME_DELIVERY_KIND, RUNTIME_DELIVERY_RECEIVED_KIND, RUNTIME_HEARTBEAT_ACK_KIND, RUNTIME_LIVENESS_READY_KIND, SESSION_CANCEL_KIND, SESSION_COMPLETED_KIND, SESSION_CONFIGURE_KIND, SESSION_ELICITATION_RESPOND_KIND, SESSION_EVENT_ACK_KIND, SESSION_EVENT_DEFERRED_KIND, SESSION_EVENT_REJECTED_KIND, SESSION_FAILED_KIND, SESSION_PERMISSION_RESPOND_KIND, SESSION_PREPARE_KIND, SESSION_PROMPT_KIND, SESSION_STARTED_KIND, SessionPromptDisposition, WORKSPACE_LIST_KIND, } from "@moxt-ai/mobius-protocol";
|
|
5
5
|
import { fetch, WebSocket } from "undici";
|
|
6
6
|
import { AcpExecutionError, AcpSessionManager } from "./acp/session-manager.js";
|
|
7
7
|
import { SqliteAcpSessionStore } from "./acp/session-store.js";
|
|
8
|
+
import { agentSettingsAdapterForAgent, applyAgentLaunchSettings } from "./agent-catalog/agent-settings-adapter.js";
|
|
8
9
|
import { supportedLocalAgentSpecifications } from "./agent-catalog/discover-local-agents.js";
|
|
9
10
|
import { AgentIntegrationDefinition, LocalAgentCatalogError, } from "./agent-catalog/local-agent.js";
|
|
10
11
|
import { publishAgentCatalog } from "./agent-catalog/publish-agent-catalog.js";
|
|
@@ -584,24 +585,138 @@ async function resolveSessionDirectories(directories, bindingId, directoryId, ad
|
|
|
584
585
|
return new ResolvedSessionDirectories(cwd, additionalDirectories, additionalDirectoryEntries);
|
|
585
586
|
}
|
|
586
587
|
async function discoverAgentSettings(command, config, directories, sessions, signal) {
|
|
587
|
-
const resolved = await resolveSessionDirectories(directories, config.bindingId, command.directoryId, command.additionalDirectoryIds, signal);
|
|
588
588
|
const agent = config.catalog.find(command.agentId);
|
|
589
|
+
const cwd = await directories.resolve(config.bindingId, "default", signal);
|
|
589
590
|
const snapshot = await sessions.inspectAgentSettings({
|
|
590
|
-
additionalDirectories:
|
|
591
|
+
additionalDirectories: [],
|
|
591
592
|
agent,
|
|
592
|
-
cwd
|
|
593
|
+
cwd,
|
|
593
594
|
signal,
|
|
594
595
|
});
|
|
596
|
+
const adapter = agentSettingsAdapterForAgent(agent.id);
|
|
597
|
+
const settings = settingsFromSnapshot(agent, snapshot.configOptions);
|
|
598
|
+
const modelEffort = await discoverModelEffort(command, agent, adapter.modelEffortResolution, snapshot.configOptions, cwd, sessions, signal);
|
|
595
599
|
return {
|
|
596
600
|
agentId: command.agentId,
|
|
597
601
|
agentName: snapshot.agentName,
|
|
598
602
|
agentVersion: snapshot.agentVersion,
|
|
599
|
-
configOptions: snapshot.configOptions,
|
|
600
|
-
directoryId: command.directoryId,
|
|
601
603
|
kind: AGENT_SETTINGS_DISCOVERED_KIND,
|
|
604
|
+
modelEffort,
|
|
602
605
|
requestId: command.requestId,
|
|
606
|
+
settings,
|
|
607
|
+
settingsRevision: settingsRevision(agent, snapshot.agentVersion, settings, modelEffort),
|
|
608
|
+
};
|
|
609
|
+
}
|
|
610
|
+
function settingFromOption(option) {
|
|
611
|
+
return {
|
|
612
|
+
booleanValue: option.booleanValue,
|
|
613
|
+
category: option.category,
|
|
614
|
+
defaultValue: option.type === "boolean" ? "" : option.currentValue,
|
|
615
|
+
description: option.description,
|
|
616
|
+
id: option.id,
|
|
617
|
+
name: option.name,
|
|
618
|
+
type: option.type,
|
|
619
|
+
values: option.values,
|
|
620
|
+
};
|
|
621
|
+
}
|
|
622
|
+
function settingsFromSnapshot(agent, configOptions) {
|
|
623
|
+
const settings = [
|
|
624
|
+
...agentSettingsAdapterForAgent(agent.id).settings(agent).map(settingFromOption),
|
|
625
|
+
...configOptions.map(settingFromOption),
|
|
626
|
+
];
|
|
627
|
+
const identifiers = new Set();
|
|
628
|
+
for (const setting of settings) {
|
|
629
|
+
if (identifiers.has(setting.id)) {
|
|
630
|
+
throw new AcpExecutionError("The Agent returned duplicate setting identifiers", {}, "invalid_session_configuration");
|
|
631
|
+
}
|
|
632
|
+
identifiers.add(setting.id);
|
|
633
|
+
}
|
|
634
|
+
if (settings.length > 128) {
|
|
635
|
+
throw new AcpExecutionError("The Agent returned too many settings", {}, "invalid_session_configuration");
|
|
636
|
+
}
|
|
637
|
+
return settings;
|
|
638
|
+
}
|
|
639
|
+
function modelOption(options) {
|
|
640
|
+
return options.find((option) => option.id === "model" || option.category === "model");
|
|
641
|
+
}
|
|
642
|
+
function effortOption(options) {
|
|
643
|
+
return options.find((option) => option.id === "reasoning_effort" || option.category === "thought_level");
|
|
644
|
+
}
|
|
645
|
+
function unavailableModelEffort() {
|
|
646
|
+
return {
|
|
647
|
+
effortSettingId: "",
|
|
648
|
+
modelSettingId: "",
|
|
649
|
+
resolution: AGENT_MODEL_EFFORT_RESOLUTION_UNAVAILABLE,
|
|
650
|
+
valuesByModel: {},
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
async function discoverModelEffort(command, agent, resolution, initialOptions, cwd, sessions, signal) {
|
|
654
|
+
const model = modelOption(initialOptions);
|
|
655
|
+
const effort = effortOption(initialOptions);
|
|
656
|
+
if (resolution !== AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE &&
|
|
657
|
+
resolution !== AGENT_MODEL_EFFORT_RESOLUTION_ON_MODEL_SELECTION) {
|
|
658
|
+
return unavailableModelEffort();
|
|
659
|
+
}
|
|
660
|
+
if (model === undefined ||
|
|
661
|
+
model.type !== "select" ||
|
|
662
|
+
model.values.length === 0 ||
|
|
663
|
+
effort === undefined ||
|
|
664
|
+
effort.type !== "select" ||
|
|
665
|
+
effort.values.length < 2) {
|
|
666
|
+
return unavailableModelEffort();
|
|
667
|
+
}
|
|
668
|
+
const inspectModel = async (modelValue) => (await sessions.inspectAgentSettings({
|
|
669
|
+
additionalDirectories: [],
|
|
670
|
+
agent,
|
|
671
|
+
cwd,
|
|
672
|
+
model: modelValue,
|
|
673
|
+
signal,
|
|
674
|
+
})).configOptions;
|
|
675
|
+
const valuesByModel = {};
|
|
676
|
+
if (resolution === "complete") {
|
|
677
|
+
for (const value of model.values) {
|
|
678
|
+
const selectedEffort = effortOption(await inspectModel(value.value));
|
|
679
|
+
valuesByModel[value.value] = selectedEffort?.type === "select" ? selectedEffort.values : [];
|
|
680
|
+
}
|
|
681
|
+
return {
|
|
682
|
+
effortSettingId: effort.id,
|
|
683
|
+
modelSettingId: model.id,
|
|
684
|
+
resolution: "complete",
|
|
685
|
+
valuesByModel,
|
|
686
|
+
};
|
|
687
|
+
}
|
|
688
|
+
if (command.model !== undefined) {
|
|
689
|
+
if (!model.values.some((value) => value.value === command.model)) {
|
|
690
|
+
throw new AcpExecutionError("The selected Agent model is unavailable", {}, "invalid_session_configuration");
|
|
691
|
+
}
|
|
692
|
+
const selectedEffort = effortOption(await inspectModel(command.model));
|
|
693
|
+
valuesByModel[command.model] = selectedEffort?.type === "select" ? selectedEffort.values : [];
|
|
694
|
+
}
|
|
695
|
+
return {
|
|
696
|
+
effortSettingId: effort.id,
|
|
697
|
+
modelSettingId: model.id,
|
|
698
|
+
resolution: "on_model_selection",
|
|
699
|
+
valuesByModel,
|
|
603
700
|
};
|
|
604
701
|
}
|
|
702
|
+
function settingsRevision(agent, reportedAgentVersion, settings, modelEffort) {
|
|
703
|
+
// A dynamic effort lookup adds one model's values to an otherwise stable
|
|
704
|
+
// Agent capability document. It must not look like the Agent's settings
|
|
705
|
+
// changed each time a caller switches models.
|
|
706
|
+
const revisionModelEffort = modelEffort.resolution === AGENT_MODEL_EFFORT_RESOLUTION_COMPLETE
|
|
707
|
+
? modelEffort
|
|
708
|
+
: { ...modelEffort, valuesByModel: {} };
|
|
709
|
+
return createHash("sha256")
|
|
710
|
+
.update(JSON.stringify({
|
|
711
|
+
adapterVersion: agent.adapterVersion,
|
|
712
|
+
agentId: agent.id,
|
|
713
|
+
agentVersion: agent.agentVersion,
|
|
714
|
+
modelEffort: revisionModelEffort,
|
|
715
|
+
reportedAgentVersion,
|
|
716
|
+
settings,
|
|
717
|
+
}))
|
|
718
|
+
.digest("hex");
|
|
719
|
+
}
|
|
605
720
|
async function executeWorkspaceList(socket, command, directories, audit, signal) {
|
|
606
721
|
try {
|
|
607
722
|
const listing = await directories.list(command.bindingId, command.directoryId, signal);
|
|
@@ -754,19 +869,24 @@ async function executePrompt(outbox, publisher, command, config, directories, au
|
|
|
754
869
|
!outbox.isTerminalExecution(command.targetCommandId, command.sessionId)) {
|
|
755
870
|
throw new AcpExecutionError("The queued prompt target is unavailable", {}, "prompt_queue_target_unavailable");
|
|
756
871
|
}
|
|
872
|
+
const appliedSettings = command.sessionConfigurations === undefined
|
|
873
|
+
? undefined
|
|
874
|
+
: agentForSessionConfiguration(agent, command.sessionConfigurations);
|
|
875
|
+
const executionAgent = appliedSettings?.agent ?? agent;
|
|
876
|
+
const sessionConfigurations = appliedSettings?.sessionConfigurations;
|
|
757
877
|
if (command.sessionConfigurations !== undefined) {
|
|
758
878
|
const prepared = await sessions.prepareExecutionSession({
|
|
759
879
|
additionalDirectories: resolved.additionalDirectories,
|
|
760
|
-
agent,
|
|
880
|
+
agent: executionAgent,
|
|
761
881
|
cwd: resolved.cwd,
|
|
762
882
|
sessionId: command.sessionId,
|
|
763
883
|
signal,
|
|
764
884
|
});
|
|
765
885
|
if (command.disposition === SessionPromptDisposition.Steer) {
|
|
766
|
-
assertCompleteSessionConfiguration(prepared.configOptions,
|
|
886
|
+
assertCompleteSessionConfiguration(prepared.configOptions, sessionConfigurations ?? []);
|
|
767
887
|
}
|
|
768
888
|
else {
|
|
769
|
-
await applyCompleteSessionConfiguration(sessions, audit, prepared.configOptions,
|
|
889
|
+
await applyCompleteSessionConfiguration(sessions, audit, prepared.configOptions, sessionConfigurations ?? [], executionAgent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId, signal);
|
|
770
890
|
}
|
|
771
891
|
}
|
|
772
892
|
audit.record({
|
|
@@ -787,7 +907,7 @@ async function executePrompt(outbox, publisher, command, config, directories, au
|
|
|
787
907
|
if (command.disposition === SessionPromptDisposition.Steer) {
|
|
788
908
|
await sessions.steerPrompt({
|
|
789
909
|
additionalDirectories: resolved.additionalDirectories,
|
|
790
|
-
agent,
|
|
910
|
+
agent: executionAgent,
|
|
791
911
|
commandId: command.commandId,
|
|
792
912
|
cwd: resolved.cwd,
|
|
793
913
|
images: attachments.images,
|
|
@@ -802,7 +922,7 @@ async function executePrompt(outbox, publisher, command, config, directories, au
|
|
|
802
922
|
else {
|
|
803
923
|
const result = await sessions.runPrompt({
|
|
804
924
|
additionalDirectories: resolved.additionalDirectories,
|
|
805
|
-
agent,
|
|
925
|
+
agent: executionAgent,
|
|
806
926
|
commandId: command.commandId,
|
|
807
927
|
cwd: resolved.cwd,
|
|
808
928
|
disposition: command.disposition,
|
|
@@ -858,6 +978,17 @@ async function executePrompt(outbox, publisher, command, config, directories, au
|
|
|
858
978
|
function invalidSessionConfiguration(message) {
|
|
859
979
|
return new AcpExecutionError(message, {}, "invalid_session_configuration");
|
|
860
980
|
}
|
|
981
|
+
function agentForSessionConfiguration(agent, selections) {
|
|
982
|
+
try {
|
|
983
|
+
return applyAgentLaunchSettings(agent, selections);
|
|
984
|
+
}
|
|
985
|
+
catch (error) {
|
|
986
|
+
if (error instanceof Error) {
|
|
987
|
+
throw invalidSessionConfiguration(error.message);
|
|
988
|
+
}
|
|
989
|
+
throw error;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
861
992
|
function validateSessionConfigurationSelection(option, selection) {
|
|
862
993
|
if (option.type !== selection.valueType) {
|
|
863
994
|
throw invalidSessionConfiguration(`The Agent setting ${selection.configId} changed type`);
|
|
@@ -920,20 +1051,17 @@ function sessionConfigurationMatches(option, selection) {
|
|
|
920
1051
|
: option.currentValue === selection.value;
|
|
921
1052
|
}
|
|
922
1053
|
function sessionConfigurationPriority(selection, options) {
|
|
923
|
-
if (selection.configId === "permission_mode") {
|
|
924
|
-
return 0;
|
|
925
|
-
}
|
|
926
1054
|
const option = options.find((candidate) => candidate.id === selection.configId);
|
|
927
1055
|
if (selection.configId === "model" || option?.category === "model") {
|
|
928
|
-
return
|
|
1056
|
+
return 0;
|
|
929
1057
|
}
|
|
930
1058
|
if (selection.configId === "reasoning_effort" || option?.category === "thought_level") {
|
|
931
|
-
return
|
|
1059
|
+
return 1;
|
|
932
1060
|
}
|
|
933
1061
|
if (option?.category === "model_config") {
|
|
934
|
-
return
|
|
1062
|
+
return 2;
|
|
935
1063
|
}
|
|
936
|
-
return
|
|
1064
|
+
return 3;
|
|
937
1065
|
}
|
|
938
1066
|
function assertCompleteSessionConfiguration(options, selections) {
|
|
939
1067
|
assertSessionConfigurationSchema(options, selections);
|
|
@@ -949,12 +1077,6 @@ function assertAppliedSessionConfiguration(options, selections) {
|
|
|
949
1077
|
const selectionsById = new Map(selections.map((selection) => [selection.configId, selection]));
|
|
950
1078
|
for (const option of options) {
|
|
951
1079
|
const selection = selectionsById.get(option.id);
|
|
952
|
-
if (option.id === AGENT_PERMISSION_MODE_CONFIG_ID) {
|
|
953
|
-
if (selection === undefined || !sessionConfigurationMatches(option, selection)) {
|
|
954
|
-
throw invalidSessionConfiguration(`The Turn configuration does not match Agent setting ${option.id}`);
|
|
955
|
-
}
|
|
956
|
-
continue;
|
|
957
|
-
}
|
|
958
1080
|
if (selection === undefined || !sessionConfigurationSelectionIsAvailable(option, selection)) {
|
|
959
1081
|
continue;
|
|
960
1082
|
}
|
|
@@ -975,26 +1097,21 @@ function unavailableSessionConfigurationCategory(selection) {
|
|
|
975
1097
|
async function applySessionConfigurationSelection(sessions, audit, options, selection, agent, cwd, additionalDirectories, commandId, sessionId, signal) {
|
|
976
1098
|
const option = options.find((candidate) => candidate.id === selection.configId);
|
|
977
1099
|
if (option === undefined) {
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
return options;
|
|
981
|
-
}
|
|
982
|
-
throw invalidSessionConfiguration(`The Agent setting ${selection.configId} is unavailable`);
|
|
1100
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, unavailableSessionConfigurationCategory(selection), "setting_unavailable");
|
|
1101
|
+
return options;
|
|
983
1102
|
}
|
|
984
|
-
if (
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
return options;
|
|
997
|
-
}
|
|
1103
|
+
if (option.type !== selection.valueType) {
|
|
1104
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "setting_schema_mismatch");
|
|
1105
|
+
return options;
|
|
1106
|
+
}
|
|
1107
|
+
if ((option.type === "boolean" && selection.value.length > 0) ||
|
|
1108
|
+
(option.type === "select" && selection.booleanValue)) {
|
|
1109
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "selection_schema_mismatch");
|
|
1110
|
+
return options;
|
|
1111
|
+
}
|
|
1112
|
+
if (option.type === "select" && !option.values.some((value) => value.value === selection.value)) {
|
|
1113
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "value_unavailable");
|
|
1114
|
+
return options;
|
|
998
1115
|
}
|
|
999
1116
|
if (sessionConfigurationMatches(option, selection)) {
|
|
1000
1117
|
return options;
|
|
@@ -1423,7 +1540,7 @@ async function runRelayConnection(config, directories, audit, sessions, installa
|
|
|
1423
1540
|
const result = await discoverAgentSettings(command, config, directories, sessions, operationSignal);
|
|
1424
1541
|
audit.record({
|
|
1425
1542
|
commandId: command.requestId,
|
|
1426
|
-
details: { agentId: command.agentId
|
|
1543
|
+
details: { agentId: command.agentId },
|
|
1427
1544
|
event: "agent_settings_discovered",
|
|
1428
1545
|
sessionId: `agent-settings:${command.agentId}`,
|
|
1429
1546
|
});
|