@moxt-ai/mobius 0.0.46 → 0.0.48
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-manager.d.ts +1 -0
- package/dist/acp/session-manager.d.ts.map +1 -1
- package/dist/acp/session-manager.js +27 -24
- package/dist/acp/session-manager.js.map +1 -1
- package/dist/agent-catalog/agent-specification.d.ts +0 -1
- package/dist/agent-catalog/agent-specification.d.ts.map +1 -1
- package/dist/agent-catalog/agent-specification.js +0 -2
- package/dist/agent-catalog/agent-specification.js.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.d.ts +0 -1
- package/dist/agent-catalog/agents/pi-agent.d.ts.map +1 -1
- package/dist/agent-catalog/agents/pi-agent.js +0 -2
- package/dist/agent-catalog/agents/pi-agent.js.map +1 -1
- package/dist/agent-catalog/discover-agent.d.ts.map +1 -1
- package/dist/agent-catalog/discover-agent.js +2 -2
- package/dist/agent-catalog/discover-agent.js.map +1 -1
- package/dist/agent-catalog/local-agent.d.ts +1 -2
- package/dist/agent-catalog/local-agent.d.ts.map +1 -1
- package/dist/agent-catalog/local-agent.js +2 -7
- package/dist/agent-catalog/local-agent.js.map +1 -1
- package/dist/bots/bot-execution-context.d.ts +0 -1
- package/dist/bots/bot-execution-context.d.ts.map +1 -1
- package/dist/bots/bot-execution-context.js +0 -7
- package/dist/bots/bot-execution-context.js.map +1 -1
- package/dist/cli.js +174 -82
- package/dist/cli.js.map +3 -3
- package/dist/index.js +173 -81
- package/dist/index.js.map +3 -3
- package/dist/run-daemon.d.ts.map +1 -1
- package/dist/run-daemon.js +89 -31
- package/dist/run-daemon.js.map +1 -1
- package/dist/runtime.js +173 -81
- package/dist/runtime.js.map +3 -3
- package/package.json +1 -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":"AA0IA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAUhD,OAAO,EAA4B,KAAK,WAAW,EAAqB,MAAM,6BAA6B,CAAC;AAsvF5G,wBAAsB,SAAS,CAC3B,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,WAAW,EACnB,KAAK,GAAE,WAA+B,GACvC,OAAO,CAAC,IAAI,CAAC,CAiKf"}
|
package/dist/run-daemon.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import { basename, join } from "node:path";
|
|
3
3
|
import { styleText } from "node:util";
|
|
4
|
-
import { AGENT_ACTIVITY_KIND, AGENT_DEFAULT_EXECUTION_SETTING, 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_SETTINGS_DISCOVER_KIND, AGENT_SETTINGS_DISCOVERED_KIND, AGENT_SETTINGS_DISCOVERY_FAILED_KIND, BOT_SESSION_PROMPT_KIND, decodeAgentInstallCancelCommand, decodeAgentInstallRequestCommand, decodeAgentSettingsDiscoverCommand, decodeBotSessionPromptCommand, 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, encodeNativeSessionResult, encodeRuntimeDeliveryReceived, encodeSessionCommandsUpdatedEvent, encodeSessionCompletedEvent, encodeSessionConfigUpdatedEvent, encodeSessionElicitationRequestedEvent, encodeSessionElicitationResolvedEvent, encodeSessionFailedEvent, encodeSessionInfoUpdatedEvent, encodeSessionOperationFailedEvent, encodeSessionPermissionRequestedEvent, encodeSessionPermissionResolvedEvent, encodeSessionReadyEvent, encodeSessionStartedEvent, encodeSessionUsageUpdatedEvent, encodeWorkspaceEntriesEvent, 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";
|
|
4
|
+
import { AGENT_ACTIVITY_KIND, AGENT_DEFAULT_EXECUTION_SETTING, 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_PERMISSION_MODE_CONFIG_ID, AGENT_SETTINGS_DISCOVER_KIND, AGENT_SETTINGS_DISCOVERED_KIND, AGENT_SETTINGS_DISCOVERY_FAILED_KIND, BOT_SESSION_PROMPT_KIND, decodeAgentInstallCancelCommand, decodeAgentInstallRequestCommand, decodeAgentSettingsDiscoverCommand, decodeBotSessionPromptCommand, 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, encodeNativeSessionResult, encodeRuntimeDeliveryReceived, encodeSessionCommandsUpdatedEvent, encodeSessionCompletedEvent, encodeSessionConfigUpdatedEvent, encodeSessionElicitationRequestedEvent, encodeSessionElicitationResolvedEvent, encodeSessionFailedEvent, encodeSessionInfoUpdatedEvent, encodeSessionOperationFailedEvent, encodeSessionPermissionRequestedEvent, encodeSessionPermissionResolvedEvent, encodeSessionReadyEvent, encodeSessionStartedEvent, encodeSessionUsageUpdatedEvent, encodeWorkspaceEntriesEvent, 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";
|
|
@@ -778,7 +778,7 @@ async function executePrompt(outbox, publisher, command, config, directories, au
|
|
|
778
778
|
assertCompleteSessionConfiguration(prepared.configOptions, command.sessionConfigurations);
|
|
779
779
|
}
|
|
780
780
|
else {
|
|
781
|
-
await applyCompleteSessionConfiguration(sessions, prepared.configOptions, command.sessionConfigurations, agent, resolved.cwd, resolved.additionalDirectories, command.sessionId, signal);
|
|
781
|
+
await applyCompleteSessionConfiguration(sessions, audit, prepared.configOptions, command.sessionConfigurations, agent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId, signal);
|
|
782
782
|
}
|
|
783
783
|
}
|
|
784
784
|
audit.record({
|
|
@@ -905,6 +905,26 @@ function assertSessionConfigurationSchema(options, selections) {
|
|
|
905
905
|
}
|
|
906
906
|
}
|
|
907
907
|
}
|
|
908
|
+
function assertSessionConfigurationCoverage(options, selections) {
|
|
909
|
+
const selectionsById = new Map(selections.map((selection) => [selection.configId, selection]));
|
|
910
|
+
if (selectionsById.size !== selections.length) {
|
|
911
|
+
throw invalidSessionConfiguration("The Turn configuration contains duplicate Agent settings");
|
|
912
|
+
}
|
|
913
|
+
for (const option of options) {
|
|
914
|
+
if (!selectionsById.has(option.id)) {
|
|
915
|
+
throw invalidSessionConfiguration(`The Turn configuration does not match Agent setting ${option.id}`);
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
function sessionConfigurationSelectionIsAvailable(option, selection) {
|
|
920
|
+
if (option.type !== selection.valueType) {
|
|
921
|
+
return false;
|
|
922
|
+
}
|
|
923
|
+
if (option.type === "boolean") {
|
|
924
|
+
return selection.value.length === 0;
|
|
925
|
+
}
|
|
926
|
+
return !selection.booleanValue && option.values.some((value) => value.value === selection.value);
|
|
927
|
+
}
|
|
908
928
|
function sessionConfigurationMatches(option, selection) {
|
|
909
929
|
validateSessionConfigurationSelection(option, selection);
|
|
910
930
|
return option.type === "boolean"
|
|
@@ -937,11 +957,57 @@ function assertCompleteSessionConfiguration(options, selections) {
|
|
|
937
957
|
}
|
|
938
958
|
}
|
|
939
959
|
}
|
|
940
|
-
|
|
960
|
+
function assertAppliedSessionConfiguration(options, selections) {
|
|
961
|
+
const selectionsById = new Map(selections.map((selection) => [selection.configId, selection]));
|
|
962
|
+
for (const option of options) {
|
|
963
|
+
const selection = selectionsById.get(option.id);
|
|
964
|
+
if (option.id === AGENT_PERMISSION_MODE_CONFIG_ID) {
|
|
965
|
+
if (selection === undefined || !sessionConfigurationMatches(option, selection)) {
|
|
966
|
+
throw invalidSessionConfiguration(`The Turn configuration does not match Agent setting ${option.id}`);
|
|
967
|
+
}
|
|
968
|
+
continue;
|
|
969
|
+
}
|
|
970
|
+
if (selection === undefined || !sessionConfigurationSelectionIsAvailable(option, selection)) {
|
|
971
|
+
continue;
|
|
972
|
+
}
|
|
973
|
+
if (!sessionConfigurationMatches(option, selection)) {
|
|
974
|
+
throw invalidSessionConfiguration(`The Turn configuration does not match Agent setting ${option.id}`);
|
|
975
|
+
}
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
function unavailableSessionConfigurationCategory(selection) {
|
|
979
|
+
if (selection.configId === "model") {
|
|
980
|
+
return "model";
|
|
981
|
+
}
|
|
982
|
+
if (selection.configId === "reasoning_effort") {
|
|
983
|
+
return "thought_level";
|
|
984
|
+
}
|
|
985
|
+
return "unknown";
|
|
986
|
+
}
|
|
987
|
+
async function applySessionConfigurationSelection(sessions, audit, options, selection, agent, cwd, additionalDirectories, commandId, sessionId, signal) {
|
|
941
988
|
const option = options.find((candidate) => candidate.id === selection.configId);
|
|
942
989
|
if (option === undefined) {
|
|
990
|
+
if (selection.configId !== AGENT_PERMISSION_MODE_CONFIG_ID) {
|
|
991
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, unavailableSessionConfigurationCategory(selection), "setting_unavailable");
|
|
992
|
+
return options;
|
|
993
|
+
}
|
|
943
994
|
throw invalidSessionConfiguration(`The Agent setting ${selection.configId} is unavailable`);
|
|
944
995
|
}
|
|
996
|
+
if (selection.configId !== AGENT_PERMISSION_MODE_CONFIG_ID) {
|
|
997
|
+
if (option.type !== selection.valueType) {
|
|
998
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "setting_schema_mismatch");
|
|
999
|
+
return options;
|
|
1000
|
+
}
|
|
1001
|
+
if ((option.type === "boolean" && selection.value.length > 0) ||
|
|
1002
|
+
(option.type === "select" && selection.booleanValue)) {
|
|
1003
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "selection_schema_mismatch");
|
|
1004
|
+
return options;
|
|
1005
|
+
}
|
|
1006
|
+
if (option.type === "select" && !option.values.some((value) => value.value === selection.value)) {
|
|
1007
|
+
warnIgnoredSetting(audit, "session_configuration_setting_ignored", commandId, sessionId, agent.id, selection, option.category, "value_unavailable");
|
|
1008
|
+
return options;
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
945
1011
|
if (sessionConfigurationMatches(option, selection)) {
|
|
946
1012
|
return options;
|
|
947
1013
|
}
|
|
@@ -958,17 +1024,17 @@ async function applySessionConfigurationSelection(sessions, options, selection,
|
|
|
958
1024
|
valueType: selection.valueType,
|
|
959
1025
|
});
|
|
960
1026
|
}
|
|
961
|
-
async function applyCompleteSessionConfiguration(sessions, initialOptions, selections, agent, cwd, additionalDirectories, sessionId, signal) {
|
|
962
|
-
|
|
1027
|
+
async function applyCompleteSessionConfiguration(sessions, audit, initialOptions, selections, agent, cwd, additionalDirectories, commandId, sessionId, signal) {
|
|
1028
|
+
assertSessionConfigurationCoverage(initialOptions, selections);
|
|
963
1029
|
let options = initialOptions;
|
|
964
1030
|
const orderedSelections = selections.toSorted((left, right) => {
|
|
965
1031
|
const priority = sessionConfigurationPriority(left, initialOptions) - sessionConfigurationPriority(right, initialOptions);
|
|
966
1032
|
return priority === 0 ? left.configId.localeCompare(right.configId) : priority;
|
|
967
1033
|
});
|
|
968
1034
|
for (const selection of orderedSelections) {
|
|
969
|
-
options = await applySessionConfigurationSelection(sessions, options, selection, agent, cwd, additionalDirectories, sessionId, signal);
|
|
1035
|
+
options = await applySessionConfigurationSelection(sessions, audit, options, selection, agent, cwd, additionalDirectories, commandId, sessionId, signal);
|
|
970
1036
|
}
|
|
971
|
-
|
|
1037
|
+
assertAppliedSessionConfiguration(options, selections);
|
|
972
1038
|
}
|
|
973
1039
|
function botExecutionAgent(agent, contextHandle, socketPath) {
|
|
974
1040
|
return new LocalAgentDefinition(agent.id, agent.label, agent.command, agent.arguments, {
|
|
@@ -977,7 +1043,7 @@ function botExecutionAgent(agent, contextHandle, socketPath) {
|
|
|
977
1043
|
MOBIUS_BOT_SOCKET: socketPath,
|
|
978
1044
|
MOBIUS_RELAY_TOKEN: "",
|
|
979
1045
|
MOBIUS_RELAY_URL: "",
|
|
980
|
-
}, agent.adapterVersion, agent.agentVersion, agent.adapterIdentity, agent.agentIdentity, agent.
|
|
1046
|
+
}, agent.adapterVersion, agent.agentVersion, agent.adapterIdentity, agent.agentIdentity, agent.capabilities, agent.permissionProfile);
|
|
981
1047
|
}
|
|
982
1048
|
function assertPreparedPermission(configOptions, permissionMode) {
|
|
983
1049
|
const permission = configOptions.find((option) => option.id === "permission_mode");
|
|
@@ -987,7 +1053,7 @@ function assertPreparedPermission(configOptions, permissionMode) {
|
|
|
987
1053
|
throw new AcpExecutionError("The required Agent permission mode is unavailable", {}, "invalid_session_configuration");
|
|
988
1054
|
}
|
|
989
1055
|
}
|
|
990
|
-
function
|
|
1056
|
+
function warnIgnoredSetting(audit, event, commandId, sessionId, agentId, selection, category, reason) {
|
|
991
1057
|
const details = {
|
|
992
1058
|
agentId,
|
|
993
1059
|
category,
|
|
@@ -995,7 +1061,6 @@ function warnIgnoredExecutionSetting(audit, commandId, sessionId, agentId, selec
|
|
|
995
1061
|
reason,
|
|
996
1062
|
requestedValue: selection.value,
|
|
997
1063
|
};
|
|
998
|
-
const event = "bot_execution_setting_ignored";
|
|
999
1064
|
audit.record({ commandId, details, event, sessionId });
|
|
1000
1065
|
process.stderr.write(`Mobius daemon warning ${JSON.stringify({ commandId, event, sessionId, ...details })}\n`);
|
|
1001
1066
|
}
|
|
@@ -1005,19 +1070,19 @@ async function applySupportedExecutionSelection(sessions, audit, configOptions,
|
|
|
1005
1070
|
}
|
|
1006
1071
|
const option = configOptions.find((candidate) => candidate.id === selection.configId);
|
|
1007
1072
|
if (option === undefined) {
|
|
1008
|
-
|
|
1073
|
+
warnIgnoredSetting(audit, "bot_execution_setting_ignored", commandId, sessionId, agent.id, selection, category, "setting_unavailable");
|
|
1009
1074
|
return configOptions;
|
|
1010
1075
|
}
|
|
1011
1076
|
if (option.type !== "select" || option.category !== category) {
|
|
1012
|
-
|
|
1077
|
+
warnIgnoredSetting(audit, "bot_execution_setting_ignored", commandId, sessionId, agent.id, selection, category, "setting_schema_mismatch");
|
|
1013
1078
|
return configOptions;
|
|
1014
1079
|
}
|
|
1015
1080
|
if (selection.valueType !== "select" || selection.booleanValue) {
|
|
1016
|
-
|
|
1081
|
+
warnIgnoredSetting(audit, "bot_execution_setting_ignored", commandId, sessionId, agent.id, selection, category, "selection_schema_mismatch");
|
|
1017
1082
|
return configOptions;
|
|
1018
1083
|
}
|
|
1019
1084
|
if (!option.values.some((value) => value.value === selection.value)) {
|
|
1020
|
-
|
|
1085
|
+
warnIgnoredSetting(audit, "bot_execution_setting_ignored", commandId, sessionId, agent.id, selection, category, "value_unavailable");
|
|
1021
1086
|
return configOptions;
|
|
1022
1087
|
}
|
|
1023
1088
|
if (option.currentValue === selection.value) {
|
|
@@ -1041,17 +1106,14 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1041
1106
|
publisher.recordAttempt(command.sessionId, encodeDaemonActivity(command, activity), attemptId);
|
|
1042
1107
|
});
|
|
1043
1108
|
try {
|
|
1044
|
-
const
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
throw new LocalBotAuthorizationError("turn_expired", "The Bot execution deadline has expired");
|
|
1109
|
+
const startDeadline = Date.parse(command.executionDeadlineAt);
|
|
1110
|
+
if (!Number.isSafeInteger(startDeadline) || startDeadline <= Date.now()) {
|
|
1111
|
+
throw new LocalBotAuthorizationError("turn_expired", "The Bot execution start deadline has expired");
|
|
1048
1112
|
}
|
|
1049
1113
|
const execution = await authorizer.authorize(command, config.catalog, directories, config.bindingId, signal);
|
|
1050
1114
|
const resolved = await resolveSessionDirectories(directories, config.bindingId, command.directoryId, command.additionalDirectoryIds, signal);
|
|
1051
1115
|
const attachments = await resolvePromptArtifacts(config, command, signal);
|
|
1052
1116
|
const applied = await applicator.apply(command, execution, attachments.resources, signal);
|
|
1053
|
-
const deadlineSignal = AbortSignal.timeout(remaining);
|
|
1054
|
-
const executionSignal = AbortSignal.any([signal, deadlineSignal]);
|
|
1055
1117
|
const startExecution = () => {
|
|
1056
1118
|
audit.record({
|
|
1057
1119
|
commandId: command.commandId,
|
|
@@ -1085,7 +1147,7 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1085
1147
|
prompt: command.prompt,
|
|
1086
1148
|
resources: applied.resources,
|
|
1087
1149
|
sessionId: command.sessionId,
|
|
1088
|
-
signal
|
|
1150
|
+
signal,
|
|
1089
1151
|
targetCommandId: command.targetCommandId,
|
|
1090
1152
|
});
|
|
1091
1153
|
}
|
|
@@ -1102,11 +1164,11 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1102
1164
|
agent,
|
|
1103
1165
|
cwd: resolved.cwd,
|
|
1104
1166
|
sessionId: command.sessionId,
|
|
1105
|
-
signal
|
|
1167
|
+
signal,
|
|
1106
1168
|
});
|
|
1107
1169
|
assertPreparedPermission(prepared.configOptions, execution.executionConfiguration.permissionMode);
|
|
1108
|
-
let configOptions = await applySupportedExecutionSelection(sessions, audit, prepared.configOptions, execution.executionConfiguration.model, "model", agent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId,
|
|
1109
|
-
configOptions = await applySupportedExecutionSelection(sessions, audit, configOptions, execution.executionConfiguration.reasoningEffort, "thought_level", agent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId,
|
|
1170
|
+
let configOptions = await applySupportedExecutionSelection(sessions, audit, prepared.configOptions, execution.executionConfiguration.model, "model", agent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId, signal);
|
|
1171
|
+
configOptions = await applySupportedExecutionSelection(sessions, audit, configOptions, execution.executionConfiguration.reasoningEffort, "thought_level", agent, resolved.cwd, resolved.additionalDirectories, command.commandId, command.sessionId, signal);
|
|
1110
1172
|
for (const selection of command.sessionConfigurations) {
|
|
1111
1173
|
await sessions.configureSession({
|
|
1112
1174
|
additionalDirectories: resolved.additionalDirectories,
|
|
@@ -1116,7 +1178,7 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1116
1178
|
cwd: resolved.cwd,
|
|
1117
1179
|
requestId: `cfg_${randomUUID()}`,
|
|
1118
1180
|
sessionId: command.sessionId,
|
|
1119
|
-
signal
|
|
1181
|
+
signal,
|
|
1120
1182
|
value: selection.value,
|
|
1121
1183
|
valueType: selection.valueType,
|
|
1122
1184
|
});
|
|
@@ -1143,7 +1205,7 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1143
1205
|
prompt: command.prompt,
|
|
1144
1206
|
resources: applied.resources,
|
|
1145
1207
|
sessionId: command.sessionId,
|
|
1146
|
-
signal
|
|
1208
|
+
signal,
|
|
1147
1209
|
targetCommandId: command.targetCommandId,
|
|
1148
1210
|
});
|
|
1149
1211
|
stopReason = result.stopReason;
|
|
@@ -1169,11 +1231,7 @@ async function executeBotPrompt(outbox, publisher, command, config, directories,
|
|
|
1169
1231
|
}
|
|
1170
1232
|
catch (error) {
|
|
1171
1233
|
activities.flush();
|
|
1172
|
-
const failure =
|
|
1173
|
-
? new LocalBotAuthorizationError("turn_expired", "The Bot execution deadline has expired", {
|
|
1174
|
-
cause: error,
|
|
1175
|
-
})
|
|
1176
|
-
: error;
|
|
1234
|
+
const failure = error;
|
|
1177
1235
|
audit.record({
|
|
1178
1236
|
commandId: command.commandId,
|
|
1179
1237
|
details: {
|