@ycodium-ai/agent-kimi 0.2.3096 → 0.2.3106

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 +24 -3
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -27074,6 +27074,24 @@ var dispatchAcpPrompt = (executor, input2) => {
27074
27074
  ]);
27075
27075
  };
27076
27076
 
27077
+ // ../../packages/ycodium-acp-executor/src/start-abort.ts
27078
+ function throwIfStartAborted(signal) {
27079
+ if (signal?.aborted) throw new Error("aborted");
27080
+ }
27081
+ async function raceStartAbort(promise2, signal) {
27082
+ void promise2.catch(() => void 0);
27083
+ throwIfStartAborted(signal);
27084
+ if (signal === void 0) return promise2;
27085
+ const aborted2 = Promise.withResolvers();
27086
+ const onAbort = () => aborted2.reject(new Error("aborted"));
27087
+ signal.addEventListener("abort", onAbort, { once: true });
27088
+ try {
27089
+ return await Promise.race([promise2, aborted2.promise]);
27090
+ } finally {
27091
+ signal.removeEventListener("abort", onAbort);
27092
+ }
27093
+ }
27094
+
27077
27095
  // ../../packages/ycodium-acp-executor/src/mcp-servers.ts
27078
27096
  function toAcpMcpServers(entries) {
27079
27097
  return (entries ?? []).map(
@@ -28132,7 +28150,7 @@ var createKimiInstance = (config2, host) => {
28132
28150
  // 还没用真机确认这家 CLI 对 cwd 之外的读怎么处理、要不要放行。确认之后再接这一栏。
28133
28151
  startSession: async (input2, signal) => {
28134
28152
  if (disposed) throw new Error("instance disposed");
28135
- if (signal?.aborted) throw new Error("aborted");
28153
+ throwIfStartAborted(signal);
28136
28154
  if (recipe.binaryPath.length === 0) {
28137
28155
  throw new Error("Kimi Code program path is not configured");
28138
28156
  }
@@ -28142,6 +28160,7 @@ var createKimiInstance = (config2, host) => {
28142
28160
  if (existing !== void 0) {
28143
28161
  await stopBooked(existing);
28144
28162
  threads.delete(input2.threadId);
28163
+ throwIfStartAborted(signal);
28145
28164
  }
28146
28165
  const env = buildSpawnEnv(recipe, recipe.homePath);
28147
28166
  const handle = await host.process.spawn({
@@ -28198,15 +28217,17 @@ var createKimiInstance = (config2, host) => {
28198
28217
  }
28199
28218
  })();
28200
28219
  try {
28201
- const started = await executor.start();
28220
+ throwIfStartAborted(signal);
28221
+ const started = await raceStartAbort(executor.start(), signal);
28202
28222
  const modeToApply = acpSessionModeToApply(
28203
28223
  input2.nativeModeId,
28204
28224
  acpCurrentModeId(started.sessionSetupResult)
28205
28225
  );
28206
28226
  if (modeToApply !== void 0) {
28207
- await executor.setNativeMode(modeToApply);
28227
+ await raceStartAbort(executor.setNativeMode(modeToApply), signal);
28208
28228
  }
28209
28229
  await yieldTick();
28230
+ throwIfStartAborted(signal);
28210
28231
  const createdAt = nowIso();
28211
28232
  const resumeCursor = {
28212
28233
  schemaVersion: RESUME_SCHEMA_VERSION,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-kimi",
3
- "version": "0.2.3096",
3
+ "version": "0.2.3106",
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.3096",
25
- "ycodium-acp-executor": "0.2.3096",
26
- "ycodium-executor-testing": "0.0.0"
24
+ "ycodium-acp-executor": "0.2.3106",
25
+ "ycodium-executor-testing": "0.0.0",
26
+ "@ycodium-ai/plugin-api": "0.2.0"
27
27
  },
28
28
  "ycodium": {
29
29
  "plugin": "./dist/index.js",