@ycodium-ai/agent-kimi 0.2.3976 → 0.2.3990
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 +3 -41
- package/package.json +4 -4
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 =
|
|
11
|
+
var PLUGIN_API_VERSION = 77;
|
|
12
12
|
|
|
13
13
|
// src/index.ts
|
|
14
14
|
import * as NodeOS6 from "node:os";
|
|
@@ -26826,9 +26826,7 @@ function createExecutorRuntime({
|
|
|
26826
26826
|
if (shared.disposed) {
|
|
26827
26827
|
return;
|
|
26828
26828
|
}
|
|
26829
|
-
eventStream.publish(
|
|
26830
|
-
options.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options.originBindingGeneration }
|
|
26831
|
-
);
|
|
26829
|
+
eventStream.publish(event);
|
|
26832
26830
|
};
|
|
26833
26831
|
const emit = publish;
|
|
26834
26832
|
const emitArtifacts = makeArtifactEmitter({
|
|
@@ -29524,38 +29522,6 @@ var CLIENT_INFO = { name: "ycodium-agent-kimi", version: "0.1.0" };
|
|
|
29524
29522
|
var yieldTick = () => new Promise((resolve4) => {
|
|
29525
29523
|
setImmediate(resolve4);
|
|
29526
29524
|
});
|
|
29527
|
-
var EventBus = class {
|
|
29528
|
-
#queued = [];
|
|
29529
|
-
#waiters = [];
|
|
29530
|
-
#closed = false;
|
|
29531
|
-
push(event) {
|
|
29532
|
-
const waiter = this.#waiters.shift();
|
|
29533
|
-
if (waiter) {
|
|
29534
|
-
waiter({ done: false, value: event });
|
|
29535
|
-
return;
|
|
29536
|
-
}
|
|
29537
|
-
this.#queued.push(event);
|
|
29538
|
-
}
|
|
29539
|
-
close() {
|
|
29540
|
-
if (this.#closed) return;
|
|
29541
|
-
this.#closed = true;
|
|
29542
|
-
while (this.#waiters.length > 0) {
|
|
29543
|
-
this.#waiters.shift()?.({ done: true, value: void 0 });
|
|
29544
|
-
}
|
|
29545
|
-
}
|
|
29546
|
-
[Symbol.asyncIterator]() {
|
|
29547
|
-
return {
|
|
29548
|
-
next: () => {
|
|
29549
|
-
const queued = this.#queued.shift();
|
|
29550
|
-
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
29551
|
-
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
29552
|
-
return new Promise((resolve4) => {
|
|
29553
|
-
this.#waiters.push(resolve4);
|
|
29554
|
-
});
|
|
29555
|
-
}
|
|
29556
|
-
};
|
|
29557
|
-
}
|
|
29558
|
-
};
|
|
29559
29525
|
function expandHomePath(value) {
|
|
29560
29526
|
if (value === "~") return NodeOS5.homedir();
|
|
29561
29527
|
if (value.startsWith("~/") || value.startsWith("~\\")) {
|
|
@@ -29614,7 +29580,6 @@ async function stopBooked(booked, processExit) {
|
|
|
29614
29580
|
}
|
|
29615
29581
|
var createKimiInstance = (config2, host) => {
|
|
29616
29582
|
const recipe = parseKimiInstanceConfig(config2);
|
|
29617
|
-
const events = new EventBus();
|
|
29618
29583
|
const threads = /* @__PURE__ */ new Map();
|
|
29619
29584
|
let disposed = false;
|
|
29620
29585
|
const usageHome = kimiEffectiveHome(resolveHomePath(recipe), process.env[recipe.homeEnvVar]);
|
|
@@ -29625,7 +29590,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29625
29590
|
);
|
|
29626
29591
|
const disposeOnce = createRetryableClose(async () => {
|
|
29627
29592
|
await stopAll();
|
|
29628
|
-
events.close();
|
|
29629
29593
|
});
|
|
29630
29594
|
const instance = {
|
|
29631
29595
|
probe: async (signal) => {
|
|
@@ -29755,7 +29719,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29755
29719
|
slashCommands: acpCommandsToSlashCommands(commands)
|
|
29756
29720
|
}),
|
|
29757
29721
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
29758
|
-
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
29759
29722
|
hooks,
|
|
29760
29723
|
// 握手声明了 `sessionCapabilities.resume`:续接走 session/resume,重新激活持久会话、
|
|
29761
29724
|
// 不重放历史(0.31.1 真机实测上下文还在);session/load 要把整段历史重放一遍,会话越长越慢。
|
|
@@ -29768,7 +29731,7 @@ var createKimiInstance = (config2, host) => {
|
|
|
29768
29731
|
...resume === void 0 ? {} : { resumeSessionId: resume.sessionId }
|
|
29769
29732
|
});
|
|
29770
29733
|
const forwarding = (async () => {
|
|
29771
|
-
for await (const event of executor.events) events.
|
|
29734
|
+
for await (const event of executor.events) input2.events.emit(event);
|
|
29772
29735
|
})();
|
|
29773
29736
|
try {
|
|
29774
29737
|
throwIfStartAborted(signal);
|
|
@@ -29916,7 +29879,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29916
29879
|
const booked = requireThread(threadId);
|
|
29917
29880
|
return { threadId, turns: booked.turns };
|
|
29918
29881
|
},
|
|
29919
|
-
events,
|
|
29920
29882
|
// 额度与 token 都读这个实例自己的账号目录(与它的 CLI 同一个)。
|
|
29921
29883
|
usage: {
|
|
29922
29884
|
...createKimiUsage({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/agent-kimi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3990",
|
|
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.
|
|
25
|
-
"
|
|
26
|
-
"ycodium-
|
|
24
|
+
"ycodium-acp-executor": "0.2.0",
|
|
25
|
+
"ycodium-executor-testing": "0.0.0",
|
|
26
|
+
"@ycodium-ai/plugin-api": "0.2.3990"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|
|
29
29
|
"plugin": "./dist/index.js",
|