@ycodium-ai/agent-kimi 0.2.2868 → 0.2.2870

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 CHANGED
@@ -43,6 +43,8 @@ var KIMI_CARD = {
43
43
  everydayHarness: false,
44
44
  capabilities: {
45
45
  sessionModelSwitch: "unsupported",
46
+ // 档位只在建会话时经 `session/set_config_option` 发一次:中途换档,宿主带 resume cursor 重开。
47
+ sessionOptionSwitch: "unsupported",
46
48
  // 与通用 ACP 同:`setRuntimeMode` 只改自己的会话记录,用户真正切得动的是
47
49
  // `nativeModeSwitch`。kimi `acp` 的 `session/set_mode plan` 实测回 `{}` 并推
48
50
  // `current_mode_update`,不存在的 modeId 被 `-32602 Unknown modeId` 拒掉。
@@ -25370,7 +25372,8 @@ function modelSelectionStateFromSetup(setup) {
25370
25372
  sessionModelsAdvertised: sessionModels !== void 0,
25371
25373
  modelConfigId,
25372
25374
  currentModelId,
25373
- advertisedModelValues: strategy === "config-option" ? modelConfigOption === void 0 ? [] : collectSessionConfigOptionValues(modelConfigOption) : collectSessionModelIds(sessionModels)
25375
+ advertisedModelValues: strategy === "config-option" ? modelConfigOption === void 0 ? [] : collectSessionConfigOptionValues(modelConfigOption) : collectSessionModelIds(sessionModels),
25376
+ configOptions: setup.configOptions
25374
25377
  };
25375
25378
  }
25376
25379
 
@@ -25995,12 +25998,13 @@ function createAcpExecutor(options) {
25995
25998
  if (value === input2.state.currentModelId) {
25996
25999
  return input2.state;
25997
26000
  }
26001
+ let configOptions = input2.state.configOptions;
25998
26002
  if (input2.state.strategy === "config-option") {
25999
- await connection.request("session/set_config_option", {
26000
- sessionId: input2.acpSessionId,
26001
- configId: input2.state.modelConfigId,
26002
- value
26003
- });
26003
+ const switched = await connection.request(
26004
+ "session/set_config_option",
26005
+ { sessionId: input2.acpSessionId, configId: input2.state.modelConfigId, value }
26006
+ );
26007
+ configOptions = switched?.configOptions ?? configOptions;
26004
26008
  } else {
26005
26009
  await connection.request("session/set_model", {
26006
26010
  sessionId: input2.acpSessionId,
@@ -26010,13 +26014,12 @@ function createAcpExecutor(options) {
26010
26014
  if (!isLive(input2.expectedGeneration)) {
26011
26015
  throw new AcpExecutorDisposedError();
26012
26016
  }
26013
- return { ...input2.state, currentModelId: value };
26017
+ return { ...input2.state, currentModelId: value, configOptions };
26014
26018
  };
26015
26019
  const applyRequestedEffort = async (input2) => {
26016
26020
  const requested = input2.requestedEffort?.trim();
26017
26021
  if (!requested) return;
26018
- const configOptions = typeof input2.setup === "object" && input2.setup !== null ? input2.setup.configOptions : void 0;
26019
- const effort = findAcpEffortConfig(configOptions);
26022
+ const effort = findAcpEffortConfig(input2.configOptions);
26020
26023
  if (effort === void 0) return;
26021
26024
  const matched = effort.choices.find((choice) => choice.value === requested);
26022
26025
  if (matched === void 0) {
@@ -26116,7 +26119,7 @@ function createAcpExecutor(options) {
26116
26119
  expectedGeneration
26117
26120
  });
26118
26121
  await applyRequestedEffort({
26119
- setup,
26122
+ configOptions: nextModelSelectionState.configOptions,
26120
26123
  acpSessionId: nextSessionId,
26121
26124
  requestedEffort: options.requestedEffort,
26122
26125
  expectedGeneration
@@ -27401,7 +27404,9 @@ var createKimiTokenReader = (input2) => {
27401
27404
  // src/kimiModels.ts
27402
27405
  import {
27403
27406
  describeExecutorSpawnFailure,
27404
- ExecutorSpawnRefusedError
27407
+ ExecutorSpawnRefusedError,
27408
+ REASONING_OPTION_LABEL,
27409
+ reasoningEffortShortLabel
27405
27410
  } from "@ycodium-ai/plugin-api/executor";
27406
27411
 
27407
27412
  // src/probeModels.ts
@@ -27421,6 +27426,27 @@ function asString4(value) {
27421
27426
  function positiveInt2(value) {
27422
27427
  return typeof value === "number" && Number.isFinite(value) && value > 0 ? Math.trunc(value) : void 0;
27423
27428
  }
27429
+ function kimiEffortDescriptor(entry) {
27430
+ const supported = entry["supportEfforts"];
27431
+ if (!Array.isArray(supported)) return void 0;
27432
+ const values = supported.flatMap((value) => {
27433
+ const effort = asString4(value);
27434
+ return effort === void 0 ? [] : [effort];
27435
+ });
27436
+ if (values.length === 0) return void 0;
27437
+ const defaultEffort = asString4(entry["defaultEffort"]);
27438
+ return {
27439
+ id: ACP_EFFORT_OPTION_ID,
27440
+ label: REASONING_OPTION_LABEL,
27441
+ type: "select",
27442
+ options: values.map((value) => ({
27443
+ id: value,
27444
+ label: reasoningEffortShortLabel(value) ?? value,
27445
+ ...value === defaultEffort ? { isDefault: true } : {}
27446
+ })),
27447
+ ...defaultEffort !== void 0 && values.includes(defaultEffort) ? { currentValue: defaultEffort } : {}
27448
+ };
27449
+ }
27424
27450
  function kimiProbeModels(stdout) {
27425
27451
  let parsed;
27426
27452
  try {
@@ -27437,10 +27463,12 @@ function kimiProbeModels(stdout) {
27437
27463
  if (trimmed.length === 0 || !isRecord9(entry)) continue;
27438
27464
  const name = asString4(entry["displayName"]);
27439
27465
  const contextWindow = positiveInt2(entry["maxContextSize"]);
27466
+ const effort = kimiEffortDescriptor(entry);
27440
27467
  out.push({
27441
27468
  slug: trimmed,
27442
27469
  ...name === void 0 ? {} : { name },
27443
- ...contextWindow === void 0 ? {} : { contextWindow }
27470
+ ...contextWindow === void 0 ? {} : { contextWindow },
27471
+ ...effort === void 0 ? {} : { capabilities: { optionDescriptors: [effort] } }
27444
27472
  });
27445
27473
  }
27446
27474
  return out;
@@ -6,7 +6,7 @@
6
6
  "placeholder": "kimi"
7
7
  },
8
8
  "homePath": {
9
- "title": "账户目录",
9
+ "title": "账号目录",
10
10
  "description": "会话和 `kimi login` 的凭据都保存在这里,因此共用同一目录的 provider 可以接手彼此的会话,目录不同的则不能。留空则使用该命令行工具的默认目录。",
11
11
  "placeholder": "例如 ~/.kimi-code-work"
12
12
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-kimi",
3
- "version": "0.2.2868",
3
+ "version": "0.2.2870",
4
4
  "description": "Kimi Code executor: runs `kimi acp` over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,9 +21,9 @@
21
21
  "@types/node": "24.12.4",
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
- "ycodium-acp-executor": "0.2.2868",
25
- "@ycodium-ai/plugin-api": "0.2.2868",
26
- "ycodium-executor-testing": "0.0.0"
24
+ "@ycodium-ai/plugin-api": "0.2.2870",
25
+ "ycodium-executor-testing": "0.0.0",
26
+ "ycodium-acp-executor": "0.2.2870"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",