@ycodium-ai/agent-kimi 0.2.2588 → 0.2.2634

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 +29 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -23822,6 +23822,10 @@ function createAcpConnection(options) {
23822
23822
  return;
23823
23823
  }
23824
23824
  pending.delete(key);
23825
+ try {
23826
+ options.onResponse?.(waiter.method);
23827
+ } catch {
23828
+ }
23825
23829
  if (Object.hasOwn(message, "error")) {
23826
23830
  const rpcError = readJsonRpcError(message["error"]);
23827
23831
  waiter.reject(
@@ -25379,6 +25383,8 @@ function createAcpExecutor(options) {
25379
25383
  let promptWaiters = [];
25380
25384
  let abortLocalPrompt;
25381
25385
  let connectionClosed = false;
25386
+ let sessionLoadInFlight = false;
25387
+ let droppedReplayUpdates = 0;
25382
25388
  const stamp = () => ({
25383
25389
  eventId: randomId(),
25384
25390
  createdAt: nowIso2()
@@ -25450,6 +25456,10 @@ function createAcpExecutor(options) {
25450
25456
  if (commands !== void 0) {
25451
25457
  availableCommands = commands;
25452
25458
  }
25459
+ if (sessionLoadInFlight) {
25460
+ droppedReplayUpdates += parsed.events.filter((event) => event._tag !== "ModeChanged").length;
25461
+ return;
25462
+ }
25453
25463
  for (const event of parsed.events) {
25454
25464
  if (event._tag === "ToolCallUpdated") {
25455
25465
  closeActiveAssistantSegment(activeTurnId);
@@ -25723,6 +25733,10 @@ function createAcpExecutor(options) {
25723
25733
  error: error62 instanceof Error ? error62.message : String(error62)
25724
25734
  });
25725
25735
  },
25736
+ // 窗口在应答帧到达的那一刻同步收掉:应答之后的通知是真输出,不能再丢。
25737
+ onResponse: (method) => {
25738
+ if (method === "session/load") sessionLoadInFlight = false;
25739
+ },
25726
25740
  onNotification: (notification) => {
25727
25741
  if (notification.method === "session/update") {
25728
25742
  handleSessionUpdate(notification.params);
@@ -25869,10 +25883,19 @@ function createAcpExecutor(options) {
25869
25883
  });
25870
25884
  nextSessionId = options.resumeSessionId;
25871
25885
  } else if (options.resumeSessionId) {
25872
- setup = await connection.request("session/load", {
25886
+ sessionLoadInFlight = true;
25887
+ try {
25888
+ setup = await connection.request("session/load", {
25889
+ sessionId: options.resumeSessionId,
25890
+ cwd: options.cwd,
25891
+ mcpServers
25892
+ });
25893
+ } finally {
25894
+ sessionLoadInFlight = false;
25895
+ }
25896
+ options.log?.info("acp session loaded; replayed history was not projected", {
25873
25897
  sessionId: options.resumeSessionId,
25874
- cwd: options.cwd,
25875
- mcpServers
25898
+ droppedReplayUpdates
25876
25899
  });
25877
25900
  nextSessionId = options.resumeSessionId;
25878
25901
  } else {
@@ -27033,6 +27056,9 @@ var createKimiInstance = (config2, host) => {
27033
27056
  ...requestedModelId === void 0 ? {} : { requestedModelId },
27034
27057
  ...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
27035
27058
  hooks,
27059
+ // 握手声明了 `sessionCapabilities.resume`:续接走 session/resume,重新激活持久会话、
27060
+ // 不重放历史(0.31.1 真机实测上下文还在);session/load 要把整段历史重放一遍,会话越长越慢。
27061
+ resumeMethod: "session/resume",
27036
27062
  ...autoApprove === void 0 ? {} : { autoApprove },
27037
27063
  // 内置编排那一条排第一,后面跟用户在插件中心配的;缺了这一栏,
27038
27064
  // `mcp__ycodium__*` 整套工具(浏览器等)在这只手的会话里都不存在。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-kimi",
3
- "version": "0.2.2588",
3
+ "version": "0.2.2634",
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-ai/plugin-api": "0.2.2588",
25
- "ycodium-executor-testing": "0.0.0",
26
- "ycodium-acp-executor": "0.2.2588"
24
+ "@ycodium-ai/plugin-api": "0.2.2634",
25
+ "ycodium-acp-executor": "0.2.2634",
26
+ "ycodium-executor-testing": "0.0.0"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",