@ycodium-ai/agent-kimi 0.2.5100 → 0.2.5192

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 +34 -18
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -8,7 +8,7 @@ var __export = (target, all) => {
8
8
  import { definePlugin } from "@ycodium-ai/plugin-api";
9
9
 
10
10
  // ../../packages/plugin-api/src/version.ts
11
- var PLUGIN_API_VERSION = 148;
11
+ var PLUGIN_API_VERSION = 153;
12
12
 
13
13
  // src/index.ts
14
14
  import * as NodeOS7 from "node:os";
@@ -28955,6 +28955,14 @@ function bindAcpInstanceThreads(input2) {
28955
28955
  });
28956
28956
  return { table, threads, requireThread, registerSession, stopSession, disposeOnce, threadOps };
28957
28957
  }
28958
+ function assertAcpInstanceCanStart(input2) {
28959
+ if (input2.disposed) throw new Error("instance disposed");
28960
+ throwIfStartAborted(input2.signal);
28961
+ if (input2.binaryPath.length === 0) throw new Error(input2.missingProgram);
28962
+ }
28963
+ function readCliVersionIfConfigured(binaryPath, probe) {
28964
+ return (signal) => binaryPath.length === 0 ? Promise.resolve(null) : probe(signal);
28965
+ }
28958
28966
  function acpProgramNotConfigured(detail) {
28959
28967
  return {
28960
28968
  installed: false,
@@ -29386,6 +29394,16 @@ function readKimiContextWindow(input2) {
29386
29394
  import * as NodeFS4 from "node:fs";
29387
29395
  import * as NodeOS5 from "node:os";
29388
29396
  import * as NodePath6 from "node:path";
29397
+
29398
+ // ../../packages/ycodium-instance-config/src/tomlScalar.ts
29399
+ function readTomlScalar(raw) {
29400
+ const quoted = /^(["'])(.*?)\1/.exec(raw.trim());
29401
+ if (quoted?.[2] !== void 0) return quoted[2];
29402
+ const [beforeComment = ""] = raw.split("#");
29403
+ return beforeComment.trim();
29404
+ }
29405
+
29406
+ // src/kimiQuota.ts
29389
29407
  import "@ycodium-ai/plugin-api/usage";
29390
29408
 
29391
29409
  // ../../packages/ycodium-credential-account/src/quotaRequest.ts
@@ -29502,12 +29520,6 @@ var isOfficialUrl = (value) => {
29502
29520
  const parsed = URL.parse(value.trim());
29503
29521
  return parsed === null ? false : KIMI_OFFICIAL_HOSTS.has(parsed.hostname.toLowerCase());
29504
29522
  };
29505
- var readTomlScalar = (raw) => {
29506
- const quoted = /^(["'])(.*?)\1/.exec(raw.trim());
29507
- if (quoted?.[2] !== void 0) return quoted[2];
29508
- const [beforeComment = ""] = raw.split("#");
29509
- return beforeComment.trim();
29510
- };
29511
29523
  var TABLE_HEADER = /^\s*\[\s*([^\]]+?)\s*\]\s*(?:#.*)?$/;
29512
29524
  var BASE_URL_LINE = /^\s*base_url\s*=\s*(\S.*)$/;
29513
29525
  var kimiConfigBaseUrls = (contents) => {
@@ -30283,20 +30295,24 @@ var createKimiInstance = (config2, host) => {
30283
30295
  };
30284
30296
  }
30285
30297
  },
30286
- readCliVersion: (signal) => recipe.binaryPath.length === 0 ? Promise.resolve(null) : probeKimiVersion({
30287
- recipe,
30288
- host,
30289
- env: homeLaunchEnv(recipe, recipe.homePath),
30290
- ...signal === void 0 ? {} : { signal }
30291
- }),
30298
+ readCliVersion: readCliVersionIfConfigured(
30299
+ recipe.binaryPath,
30300
+ (signal) => probeKimiVersion({
30301
+ recipe,
30302
+ host,
30303
+ env: homeLaunchEnv(recipe, recipe.homePath),
30304
+ ...signal === void 0 ? {} : { signal }
30305
+ })
30306
+ ),
30292
30307
  // 暂不处理 input.readOnlyDirectories(有意为之):kimi 经共享的 ycodium-acp-executor 起会话,
30293
30308
  // 还没用真机确认这家 CLI 对 cwd 之外的读怎么处理、要不要放行。确认之后再接这一栏。
30294
30309
  startSession: async (input2, signal) => {
30295
- if (disposed) throw new Error("instance disposed");
30296
- throwIfStartAborted(signal);
30297
- if (recipe.binaryPath.length === 0) {
30298
- throw new Error("Kimi Code program path is not configured");
30299
- }
30310
+ assertAcpInstanceCanStart({
30311
+ disposed,
30312
+ binaryPath: recipe.binaryPath,
30313
+ missingProgram: "Kimi Code program path is not configured",
30314
+ ...signal === void 0 ? {} : { signal }
30315
+ });
30300
30316
  const cwd = input2.cwd ?? host.workspacePath(input2.threadId);
30301
30317
  if (cwd.trim() === "") throw new Error("workspace path missing");
30302
30318
  await stopExistingAcpThread(table, input2.threadId, () => disposed, signal);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-kimi",
3
- "version": "0.2.5100",
3
+ "version": "0.2.5192",
4
4
  "description": "Kimi Code executor: runs `kimi acp` over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -21,11 +21,11 @@
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.5100",
25
- "ycodium-acp-executor": "0.2.5100",
24
+ "ycodium-acp-executor": "0.2.0",
25
+ "@ycodium-ai/plugin-api": "0.2.0",
26
+ "ycodium-credential-account": "0.0.0",
26
27
  "ycodium-executor-testing": "0.0.0",
27
- "ycodium-instance-config": "0.0.0",
28
- "ycodium-credential-account": "0.0.0"
28
+ "ycodium-instance-config": "0.0.0"
29
29
  },
30
30
  "ycodium": {
31
31
  "plugin": "./dist/index.js",