@alas-ide/codex-acp 2.5.0-alas.7 → 2.5.0-alas.8

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.
Files changed (2) hide show
  1. package/dist/index.js +33 -15
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -32123,6 +32123,7 @@ var CODEX_ADDITIONAL_PERMISSIONS_TITLE = "Grant permissions?";
32123
32123
  var PERMISSION_PROMPT_META_KEY = "permission_prompt";
32124
32124
  var NEUTRAL_PERMISSION_PRESENTATION_META_KEY = "permissionPresentation";
32125
32125
  var NEUTRAL_QUESTION_CUSTOM_ANSWER_META_KEY = "questionCustomAnswer";
32126
+ var NEUTRAL_RECOMMENDED_CONFIG_VALUE_META_KEY = "recommendedConfigValue";
32126
32127
  function neutralPresentationCapability() {
32127
32128
  return { version: 1 };
32128
32129
  }
@@ -35092,7 +35093,8 @@ var ClientCapabilities = class _ClientCapabilities {
35092
35093
  agentFileChangeReportFormat: "none",
35093
35094
  permissionPromptFields: false,
35094
35095
  neutralPermissionPresentation: false,
35095
- neutralQuestionCustomAnswer: false
35096
+ neutralQuestionCustomAnswer: false,
35097
+ neutralRecommendedConfigValue: false
35096
35098
  });
35097
35099
  /** The client declares `_meta.jetbrains.air`. */
35098
35100
  airClient;
@@ -35118,6 +35120,8 @@ var ClientCapabilities = class _ClientCapabilities {
35118
35120
  neutralPermissionPresentation;
35119
35121
  /** A question's note field carries `_meta.questionCustomAnswer`. Only ACP v1 reads the opt-in. */
35120
35122
  neutralQuestionCustomAnswer;
35123
+ /** Model and effort selectors carry `_meta.recommendedConfigValue`. Only ACP v1 reads the opt-in. */
35124
+ neutralRecommendedConfigValue;
35121
35125
  constructor(values) {
35122
35126
  this.airClient = values.airClient;
35123
35127
  this.airToolCallContract = values.airToolCallContract;
@@ -35133,6 +35137,7 @@ var ClientCapabilities = class _ClientCapabilities {
35133
35137
  this.permissionPromptFields = values.permissionPromptFields;
35134
35138
  this.neutralPermissionPresentation = values.neutralPermissionPresentation;
35135
35139
  this.neutralQuestionCustomAnswer = values.neutralQuestionCustomAnswer;
35140
+ this.neutralRecommendedConfigValue = values.neutralRecommendedConfigValue;
35136
35141
  }
35137
35142
  static from(capabilities) {
35138
35143
  const airClient = isAirClient(capabilities);
@@ -35159,7 +35164,8 @@ var ClientCapabilities = class _ClientCapabilities {
35159
35164
  agentFileChangeReportFormat: clientRequestsNeutralAgentFileChangeReport(capabilities) ? "neutral" : clientSupportsAirCapability(capabilities, AIR_AGENT_FILE_CHANGE_REPORT_KEY) ? "air" : "none",
35160
35165
  permissionPromptFields: false,
35161
35166
  neutralPermissionPresentation: clientRequestsNeutralPresentation(capabilities, NEUTRAL_PERMISSION_PRESENTATION_META_KEY),
35162
- neutralQuestionCustomAnswer: clientRequestsNeutralPresentation(capabilities, NEUTRAL_QUESTION_CUSTOM_ANSWER_META_KEY)
35167
+ neutralQuestionCustomAnswer: clientRequestsNeutralPresentation(capabilities, NEUTRAL_QUESTION_CUSTOM_ANSWER_META_KEY),
35168
+ neutralRecommendedConfigValue: clientRequestsNeutralPresentation(capabilities, NEUTRAL_RECOMMENDED_CONFIG_VALUE_META_KEY)
35163
35169
  });
35164
35170
  }
35165
35171
  /**
@@ -35188,7 +35194,8 @@ var ClientCapabilities = class _ClientCapabilities {
35188
35194
  permissionPromptFields: true,
35189
35195
  // A v2 request has its own title and description, so v2 ignores both client-neutral opt-ins.
35190
35196
  neutralPermissionPresentation: false,
35191
- neutralQuestionCustomAnswer: false
35197
+ neutralQuestionCustomAnswer: false,
35198
+ neutralRecommendedConfigValue: false
35192
35199
  });
35193
35200
  }
35194
35201
  /**
@@ -35476,7 +35483,13 @@ function modelOptions(availableModels, currentBaseModelId) {
35476
35483
  }
35477
35484
  return options;
35478
35485
  }
35479
- function createModelConfigOption(availableModels, currentBaseModelId, recommendedModelId) {
35486
+ function recommendationMeta(value, records) {
35487
+ return {
35488
+ ...records.air ? withAirMeta(void 0, AIR_RECOMMENDED_CONFIG_VALUE_KEY, value) : {},
35489
+ ...records.neutral ? { [NEUTRAL_RECOMMENDED_CONFIG_VALUE_META_KEY]: { version: 1, value } } : {}
35490
+ };
35491
+ }
35492
+ function createModelConfigOption(availableModels, currentBaseModelId, recommendedModelId, records = { air: true, neutral: false }) {
35480
35493
  const options = modelOptions(availableModels, currentBaseModelId);
35481
35494
  const recommendation = recommendedModelId && options.some((option) => option.value === recommendedModelId) ? recommendedModelId : void 0;
35482
35495
  return {
@@ -35487,10 +35500,10 @@ function createModelConfigOption(availableModels, currentBaseModelId, recommende
35487
35500
  type: "select",
35488
35501
  currentValue: currentBaseModelId,
35489
35502
  options,
35490
- ...recommendation ? { _meta: withAirMeta(void 0, AIR_RECOMMENDED_CONFIG_VALUE_KEY, recommendation) } : {}
35503
+ ...recommendation ? { _meta: recommendationMeta(recommendation, records) } : {}
35491
35504
  };
35492
35505
  }
35493
- function createReasoningEffortConfigOption(supportedReasoningEfforts, currentEffort, recommendedEffort) {
35506
+ function createReasoningEffortConfigOption(supportedReasoningEfforts, currentEffort, recommendedEffort, records = { air: true, neutral: false }) {
35494
35507
  const recommendation = findSupportedEffort(supportedReasoningEfforts, recommendedEffort);
35495
35508
  return {
35496
35509
  id: REASONING_EFFORT_CONFIG_ID,
@@ -35504,7 +35517,7 @@ function createReasoningEffortConfigOption(supportedReasoningEfforts, currentEff
35504
35517
  name: capitalize(option.reasoningEffort),
35505
35518
  description: option.description
35506
35519
  })),
35507
- ...recommendation ? { _meta: withAirMeta(void 0, AIR_RECOMMENDED_CONFIG_VALUE_KEY, recommendation) } : {}
35520
+ ...recommendation ? { _meta: recommendationMeta(recommendation, records) } : {}
35508
35521
  };
35509
35522
  }
35510
35523
  function createSubagentModelConfigOption(availableModels, parentBaseModelId, model) {
@@ -40753,7 +40766,7 @@ var package_default = {
40753
40766
  publishConfig: {
40754
40767
  access: "public"
40755
40768
  },
40756
- version: "2.5.0-alas.7",
40769
+ version: "2.5.0-alas.8",
40757
40770
  description: "",
40758
40771
  main: "dist/index.js",
40759
40772
  bin: {
@@ -40831,7 +40844,7 @@ var package_default = {
40831
40844
  alasDownstream: {
40832
40845
  upstreamVersion: "2.5.0",
40833
40846
  upstreamCommit: "34e08970aa324a2be985f5080674d5aa91d7666f",
40834
- sourceCommit: "4b88aaf47a9765b7b64a51712cca179fc141fa46"
40847
+ sourceCommit: "bd5ff04afa9b20774e3a7ff1559172fbf50fe9f4"
40835
40848
  }
40836
40849
  };
40837
40850
 
@@ -52715,6 +52728,9 @@ var CodexAcpServer = class {
52715
52728
  ...this.capabilities.neutralQuestionCustomAnswer ? {
52716
52729
  [NEUTRAL_QUESTION_CUSTOM_ANSWER_META_KEY]: neutralPresentationCapability()
52717
52730
  } : {},
52731
+ ...this.capabilities.neutralRecommendedConfigValue ? {
52732
+ [NEUTRAL_RECOMMENDED_CONFIG_VALUE_META_KEY]: neutralPresentationCapability()
52733
+ } : {},
52718
52734
  // The session index for a client that opted in without AIR, see `docs/air-extensions.md`.
52719
52735
  ...neutralSessionIndex ? {
52720
52736
  [NEUTRAL_SESSION_INDEX_META_KEY]: neutralSessionIndex
@@ -54763,10 +54779,11 @@ You have been logged out. Please try again.`);
54763
54779
  }
54764
54780
  createSessionConfigOptions(sessionState) {
54765
54781
  const currentModelId = ModelId.fromString(sessionState.currentModelId);
54766
- const useRecommendedValue = clientSupportsAirCapability(
54767
- this.clientCapabilities,
54768
- AIR_RECOMMENDED_CONFIG_VALUE_KEY
54769
- );
54782
+ const records = {
54783
+ air: clientSupportsAirCapability(this.clientCapabilities, AIR_RECOMMENDED_CONFIG_VALUE_KEY),
54784
+ neutral: this.capabilities.neutralRecommendedConfigValue
54785
+ };
54786
+ const useRecommendedValue = records.air || records.neutral;
54770
54787
  const currentModel = this.findCurrentModel(sessionState.availableModels, sessionState.currentModelId);
54771
54788
  const recommendedModelId = useRecommendedValue ? sessionState.availableModels.find((model) => model.isDefault)?.id : void 0;
54772
54789
  const configOptions = [
@@ -54774,14 +54791,15 @@ You have been logged out. Please try again.`);
54774
54791
  createCollaborationModeConfigOption(sessionState.collaborationMode)
54775
54792
  ];
54776
54793
  if (sessionState.availableModels.length > 0) {
54777
- configOptions.push(createModelConfigOption(sessionState.availableModels, currentModelId.model, recommendedModelId));
54794
+ configOptions.push(createModelConfigOption(sessionState.availableModels, currentModelId.model, recommendedModelId, records));
54778
54795
  }
54779
54796
  if (sessionState.supportedReasoningEfforts.length > 0) {
54780
54797
  configOptions.push(
54781
54798
  createReasoningEffortConfigOption(
54782
54799
  sessionState.supportedReasoningEfforts,
54783
54800
  currentModelId.effort,
54784
- useRecommendedValue ? currentModel?.defaultReasoningEffort : void 0
54801
+ useRecommendedValue ? currentModel?.defaultReasoningEffort : void 0,
54802
+ records
54785
54803
  )
54786
54804
  );
54787
54805
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "2.5.0-alas.7",
6
+ "version": "2.5.0-alas.8",
7
7
  "description": "",
8
8
  "main": "dist/index.js",
9
9
  "bin": {
@@ -81,6 +81,6 @@
81
81
  "alasDownstream": {
82
82
  "upstreamVersion": "2.5.0",
83
83
  "upstreamCommit": "34e08970aa324a2be985f5080674d5aa91d7666f",
84
- "sourceCommit": "4b88aaf47a9765b7b64a51712cca179fc141fa46"
84
+ "sourceCommit": "bd5ff04afa9b20774e3a7ff1559172fbf50fe9f4"
85
85
  }
86
86
  }