@agentclientprotocol/codex-acp 2.5.1-preview.8 → 2.5.1-preview.9
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/index.js +55 -47
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -41064,7 +41064,7 @@ var package_default = {
|
|
|
41064
41064
|
publishConfig: {
|
|
41065
41065
|
access: "public"
|
|
41066
41066
|
},
|
|
41067
|
-
version: "2.5.1-preview.
|
|
41067
|
+
version: "2.5.1-preview.9",
|
|
41068
41068
|
description: "",
|
|
41069
41069
|
main: "dist/index.js",
|
|
41070
41070
|
bin: {
|
|
@@ -51788,7 +51788,11 @@ You have been logged out. Please try again.`);
|
|
|
51788
51788
|
modeId: _params.modeId
|
|
51789
51789
|
});
|
|
51790
51790
|
const sessionState = this.getSessionState(_params.sessionId);
|
|
51791
|
-
this.
|
|
51791
|
+
await this.applySessionConfigOption(sessionState, {
|
|
51792
|
+
sessionId: _params.sessionId,
|
|
51793
|
+
configId: MODE_CONFIG_ID,
|
|
51794
|
+
value: _params.modeId
|
|
51795
|
+
});
|
|
51792
51796
|
return {};
|
|
51793
51797
|
}
|
|
51794
51798
|
async setSessionConfigOption(params) {
|
|
@@ -51800,7 +51804,7 @@ You have been logged out. Please try again.`);
|
|
|
51800
51804
|
const sessionState = this.getSessionState(params.sessionId);
|
|
51801
51805
|
await this.applySessionConfigOption(sessionState, params);
|
|
51802
51806
|
return {
|
|
51803
|
-
configOptions: this.createSessionConfigOptions(
|
|
51807
|
+
configOptions: this.createSessionConfigOptions(this.getSessionState(params.sessionId))
|
|
51804
51808
|
};
|
|
51805
51809
|
}
|
|
51806
51810
|
async setSessionConfigOptionV2(params) {
|
|
@@ -51812,24 +51816,37 @@ You have been logged out. Please try again.`);
|
|
|
51812
51816
|
return { configOptions: toV2ConfigOptions(response.configOptions) };
|
|
51813
51817
|
}
|
|
51814
51818
|
async applySessionConfigOption(sessionState, params) {
|
|
51815
|
-
|
|
51816
|
-
|
|
51817
|
-
|
|
51818
|
-
|
|
51819
|
-
|
|
51820
|
-
|
|
51821
|
-
|
|
51822
|
-
|
|
51823
|
-
|
|
51824
|
-
|
|
51825
|
-
|
|
51826
|
-
|
|
51827
|
-
|
|
51828
|
-
|
|
51829
|
-
|
|
51830
|
-
|
|
51831
|
-
|
|
51832
|
-
|
|
51819
|
+
await this.updateSessionConfig(sessionState, async () => {
|
|
51820
|
+
switch (params.configId) {
|
|
51821
|
+
case FAST_MODE_CONFIG_ID:
|
|
51822
|
+
this.applyFastModeChange(sessionState, params);
|
|
51823
|
+
break;
|
|
51824
|
+
case MODE_CONFIG_ID:
|
|
51825
|
+
this.applyModeChange(sessionState, this.stringConfigValue(params));
|
|
51826
|
+
break;
|
|
51827
|
+
case COLLABORATION_MODE_CONFIG_ID:
|
|
51828
|
+
await this.applyCollaborationModeChange(sessionState, this.stringConfigValue(params));
|
|
51829
|
+
break;
|
|
51830
|
+
case MODEL_CONFIG_ID:
|
|
51831
|
+
this.applyModelChange(sessionState, this.stringConfigValue(params));
|
|
51832
|
+
break;
|
|
51833
|
+
case REASONING_EFFORT_CONFIG_ID:
|
|
51834
|
+
this.applyReasoningEffortChange(sessionState, this.stringConfigValue(params));
|
|
51835
|
+
break;
|
|
51836
|
+
default:
|
|
51837
|
+
throw RequestError.invalidParams();
|
|
51838
|
+
}
|
|
51839
|
+
});
|
|
51840
|
+
}
|
|
51841
|
+
async updateSessionConfig(sessionState, change) {
|
|
51842
|
+
const previous = JSON.stringify(this.createSessionConfigOptions(sessionState));
|
|
51843
|
+
await change();
|
|
51844
|
+
const configOptions = this.createSessionConfigOptions(sessionState);
|
|
51845
|
+
if (this.isSessionConfigEnabled() && this.sessions.get(sessionState.sessionId) === sessionState && JSON.stringify(configOptions) !== previous) {
|
|
51846
|
+
await new ACPSessionConnection(this.connection, sessionState.sessionId).update({
|
|
51847
|
+
sessionUpdate: "config_option_update",
|
|
51848
|
+
configOptions
|
|
51849
|
+
});
|
|
51833
51850
|
}
|
|
51834
51851
|
}
|
|
51835
51852
|
applyFastModeChange(sessionState, params) {
|
|
@@ -51894,20 +51911,15 @@ You have been logged out. Please try again.`);
|
|
|
51894
51911
|
* The session keeps its model when it can, the way a resumed thread keeps its own; see `createModelId`.
|
|
51895
51912
|
*/
|
|
51896
51913
|
async applyResumedModels(sessionState, client, resumed) {
|
|
51897
|
-
|
|
51898
|
-
|
|
51899
|
-
|
|
51900
|
-
|
|
51901
|
-
|
|
51902
|
-
|
|
51903
|
-
|
|
51904
|
-
|
|
51905
|
-
|
|
51906
|
-
await new ACPSessionConnection(this.connection, sessionState.sessionId).update({
|
|
51907
|
-
sessionUpdate: "config_option_update",
|
|
51908
|
-
configOptions: this.createSessionConfigOptions(sessionState)
|
|
51909
|
-
});
|
|
51910
|
-
}
|
|
51914
|
+
await this.updateSessionConfig(sessionState, () => {
|
|
51915
|
+
const { model, effort } = ModelId.fromString(sessionState.currentModelId);
|
|
51916
|
+
sessionState.availableModels = resumed.models;
|
|
51917
|
+
sessionState.currentModelId = client.createModelId(resumed.models, model, effort).toString();
|
|
51918
|
+
const currentModel = this.findCurrentModel(resumed.models, sessionState.currentModelId);
|
|
51919
|
+
sessionState.supportedReasoningEfforts = currentModel?.supportedReasoningEfforts ?? [];
|
|
51920
|
+
sessionState.supportedInputModalities = currentModel?.inputModalities ?? ["text", "image"];
|
|
51921
|
+
sessionState.currentModelSupportsFast = modelSupportsFast(currentModel);
|
|
51922
|
+
});
|
|
51911
51923
|
}
|
|
51912
51924
|
applyModelAndEffort(sessionState, model, effort) {
|
|
51913
51925
|
sessionState.currentModelId = ModelId.fromComponents(model, effort).toString();
|
|
@@ -51938,8 +51950,10 @@ You have been logged out. Please try again.`);
|
|
|
51938
51950
|
} else {
|
|
51939
51951
|
reasoningEffort = model.defaultReasoningEffort;
|
|
51940
51952
|
}
|
|
51941
|
-
sessionState
|
|
51942
|
-
|
|
51953
|
+
await this.updateSessionConfig(sessionState, () => {
|
|
51954
|
+
sessionState.availableModels = models;
|
|
51955
|
+
this.applyModelAndEffort(sessionState, model, reasoningEffort);
|
|
51956
|
+
});
|
|
51943
51957
|
return {};
|
|
51944
51958
|
}
|
|
51945
51959
|
parseLegacySetSessionModelParams(params) {
|
|
@@ -53722,11 +53736,6 @@ You have been logged out. Please try again.`);
|
|
|
53722
53736
|
configId,
|
|
53723
53737
|
value
|
|
53724
53738
|
});
|
|
53725
|
-
const session = new ACPSessionConnection(this.connection, sessionState.sessionId);
|
|
53726
|
-
await session.update({
|
|
53727
|
-
sessionUpdate: "config_option_update",
|
|
53728
|
-
configOptions: this.createSessionConfigOptions(sessionState)
|
|
53729
|
-
});
|
|
53730
53739
|
}
|
|
53731
53740
|
});
|
|
53732
53741
|
void commandPromise.catch((err) => {
|
|
@@ -53895,11 +53904,10 @@ You have been logged out. Please try again.`);
|
|
|
53895
53904
|
return cancelledPromptResponse();
|
|
53896
53905
|
}
|
|
53897
53906
|
if (approved && !this.promptShouldStop(params.sessionId, activePrompt)) {
|
|
53898
|
-
await this.
|
|
53899
|
-
|
|
53900
|
-
|
|
53901
|
-
|
|
53902
|
-
configOptions: this.createSessionConfigOptions(sessionState)
|
|
53907
|
+
await this.applySessionConfigOption(sessionState, {
|
|
53908
|
+
sessionId: sessionState.sessionId,
|
|
53909
|
+
configId: COLLABORATION_MODE_CONFIG_ID,
|
|
53910
|
+
value: DEFAULT_COLLABORATION_MODE
|
|
53903
53911
|
});
|
|
53904
53912
|
const implementationRequest = {
|
|
53905
53913
|
sessionId: params.sessionId,
|