@ycodium-ai/agent-kimi 0.2.3935 → 0.2.3982
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 +8 -41
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -6,6 +6,11 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
9
|
+
|
|
10
|
+
// ../../packages/plugin-api/src/version.ts
|
|
11
|
+
var PLUGIN_API_VERSION = 76;
|
|
12
|
+
|
|
13
|
+
// src/index.ts
|
|
9
14
|
import * as NodeOS6 from "node:os";
|
|
10
15
|
import * as NodePath8 from "node:path";
|
|
11
16
|
import {
|
|
@@ -26821,9 +26826,7 @@ function createExecutorRuntime({
|
|
|
26821
26826
|
if (shared.disposed) {
|
|
26822
26827
|
return;
|
|
26823
26828
|
}
|
|
26824
|
-
eventStream.publish(
|
|
26825
|
-
options.originBindingGeneration === void 0 ? event : { ...event, originBindingGeneration: options.originBindingGeneration }
|
|
26826
|
-
);
|
|
26829
|
+
eventStream.publish(event);
|
|
26827
26830
|
};
|
|
26828
26831
|
const emit = publish;
|
|
26829
26832
|
const emitArtifacts = makeArtifactEmitter({
|
|
@@ -29519,38 +29522,6 @@ var CLIENT_INFO = { name: "ycodium-agent-kimi", version: "0.1.0" };
|
|
|
29519
29522
|
var yieldTick = () => new Promise((resolve4) => {
|
|
29520
29523
|
setImmediate(resolve4);
|
|
29521
29524
|
});
|
|
29522
|
-
var EventBus = class {
|
|
29523
|
-
#queued = [];
|
|
29524
|
-
#waiters = [];
|
|
29525
|
-
#closed = false;
|
|
29526
|
-
push(event) {
|
|
29527
|
-
const waiter = this.#waiters.shift();
|
|
29528
|
-
if (waiter) {
|
|
29529
|
-
waiter({ done: false, value: event });
|
|
29530
|
-
return;
|
|
29531
|
-
}
|
|
29532
|
-
this.#queued.push(event);
|
|
29533
|
-
}
|
|
29534
|
-
close() {
|
|
29535
|
-
if (this.#closed) return;
|
|
29536
|
-
this.#closed = true;
|
|
29537
|
-
while (this.#waiters.length > 0) {
|
|
29538
|
-
this.#waiters.shift()?.({ done: true, value: void 0 });
|
|
29539
|
-
}
|
|
29540
|
-
}
|
|
29541
|
-
[Symbol.asyncIterator]() {
|
|
29542
|
-
return {
|
|
29543
|
-
next: () => {
|
|
29544
|
-
const queued = this.#queued.shift();
|
|
29545
|
-
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
29546
|
-
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
29547
|
-
return new Promise((resolve4) => {
|
|
29548
|
-
this.#waiters.push(resolve4);
|
|
29549
|
-
});
|
|
29550
|
-
}
|
|
29551
|
-
};
|
|
29552
|
-
}
|
|
29553
|
-
};
|
|
29554
29525
|
function expandHomePath(value) {
|
|
29555
29526
|
if (value === "~") return NodeOS5.homedir();
|
|
29556
29527
|
if (value.startsWith("~/") || value.startsWith("~\\")) {
|
|
@@ -29609,7 +29580,6 @@ async function stopBooked(booked, processExit) {
|
|
|
29609
29580
|
}
|
|
29610
29581
|
var createKimiInstance = (config2, host) => {
|
|
29611
29582
|
const recipe = parseKimiInstanceConfig(config2);
|
|
29612
|
-
const events = new EventBus();
|
|
29613
29583
|
const threads = /* @__PURE__ */ new Map();
|
|
29614
29584
|
let disposed = false;
|
|
29615
29585
|
const usageHome = kimiEffectiveHome(resolveHomePath(recipe), process.env[recipe.homeEnvVar]);
|
|
@@ -29620,7 +29590,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29620
29590
|
);
|
|
29621
29591
|
const disposeOnce = createRetryableClose(async () => {
|
|
29622
29592
|
await stopAll();
|
|
29623
|
-
events.close();
|
|
29624
29593
|
});
|
|
29625
29594
|
const instance = {
|
|
29626
29595
|
probe: async (signal) => {
|
|
@@ -29750,7 +29719,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29750
29719
|
slashCommands: acpCommandsToSlashCommands(commands)
|
|
29751
29720
|
}),
|
|
29752
29721
|
...requestedModelId === void 0 ? {} : { requestedModelId },
|
|
29753
|
-
...input2.bindingGeneration === void 0 ? {} : { originBindingGeneration: input2.bindingGeneration },
|
|
29754
29722
|
hooks,
|
|
29755
29723
|
// 握手声明了 `sessionCapabilities.resume`:续接走 session/resume,重新激活持久会话、
|
|
29756
29724
|
// 不重放历史(0.31.1 真机实测上下文还在);session/load 要把整段历史重放一遍,会话越长越慢。
|
|
@@ -29763,7 +29731,7 @@ var createKimiInstance = (config2, host) => {
|
|
|
29763
29731
|
...resume === void 0 ? {} : { resumeSessionId: resume.sessionId }
|
|
29764
29732
|
});
|
|
29765
29733
|
const forwarding = (async () => {
|
|
29766
|
-
for await (const event of executor.events) events.
|
|
29734
|
+
for await (const event of executor.events) input2.events.emit(event);
|
|
29767
29735
|
})();
|
|
29768
29736
|
try {
|
|
29769
29737
|
throwIfStartAborted(signal);
|
|
@@ -29911,7 +29879,6 @@ var createKimiInstance = (config2, host) => {
|
|
|
29911
29879
|
const booked = requireThread(threadId);
|
|
29912
29880
|
return { threadId, turns: booked.turns };
|
|
29913
29881
|
},
|
|
29914
|
-
events,
|
|
29915
29882
|
// 额度与 token 都读这个实例自己的账号目录(与它的 CLI 同一个)。
|
|
29916
29883
|
usage: {
|
|
29917
29884
|
...createKimiUsage({
|
|
@@ -29943,7 +29910,7 @@ var executors = [
|
|
|
29943
29910
|
];
|
|
29944
29911
|
var index_default = definePlugin({
|
|
29945
29912
|
id: "agent-kimi",
|
|
29946
|
-
apiVersion:
|
|
29913
|
+
apiVersion: PLUGIN_API_VERSION,
|
|
29947
29914
|
executors,
|
|
29948
29915
|
activate(ctx) {
|
|
29949
29916
|
ctx.command({
|
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.3982",
|
|
4
4
|
"description": "Kimi Code executor: runs `kimi acp` over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -21,8 +21,8 @@
|
|
|
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.
|
|
25
|
-
"ycodium-acp-executor": "0.2.
|
|
24
|
+
"@ycodium-ai/plugin-api": "0.2.3982",
|
|
25
|
+
"ycodium-acp-executor": "0.2.3982",
|
|
26
26
|
"ycodium-executor-testing": "0.0.0"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|