@ycodium-ai/agent-kimi 0.2.3710 → 0.2.3799
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 +105 -65
- package/locales/en.json +9 -0
- package/locales/zh-CN.json +9 -0
- package/package.json +6 -4
package/dist/index.js
CHANGED
|
@@ -6,6 +6,13 @@ var __export = (target, all) => {
|
|
|
6
6
|
|
|
7
7
|
// src/index.ts
|
|
8
8
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
9
|
+
import * as NodeOS6 from "node:os";
|
|
10
|
+
import * as NodePath8 from "node:path";
|
|
11
|
+
import {
|
|
12
|
+
EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
13
|
+
executorHomeEffectiveValue,
|
|
14
|
+
readExecutorEffectiveRequest
|
|
15
|
+
} from "@ycodium-ai/plugin-api/executor";
|
|
9
16
|
|
|
10
17
|
// src/card.ts
|
|
11
18
|
var KIMI_DRIVER_KIND = "kimiCode";
|
|
@@ -16,6 +23,8 @@ var KIMI_CARD = {
|
|
|
16
23
|
commandName: "kimi",
|
|
17
24
|
launchArgs: "acp",
|
|
18
25
|
homeEnvVar: "KIMI_CODE_HOME",
|
|
26
|
+
// 设置表单里留空的格子此刻会用什么,见 index.ts 的同名命令。
|
|
27
|
+
effectiveCommand: "effectiveConfig",
|
|
19
28
|
environment: [],
|
|
20
29
|
// 官方安装器装进 ~/.kimi-code(安装器的 KIMI_INSTALL_DIR 默认值)。
|
|
21
30
|
install: {
|
|
@@ -310,8 +319,8 @@ var UnboundedEventStream = class {
|
|
|
310
319
|
iterators.subscribers.delete(subscriber);
|
|
311
320
|
return { value: void 0, done: true };
|
|
312
321
|
}
|
|
313
|
-
await new Promise((
|
|
314
|
-
subscriber.wake =
|
|
322
|
+
await new Promise((resolve4) => {
|
|
323
|
+
subscriber.wake = resolve4;
|
|
315
324
|
});
|
|
316
325
|
}
|
|
317
326
|
},
|
|
@@ -6506,7 +6515,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
6506
6515
|
var NONE = 0;
|
|
6507
6516
|
var ASSUMED = 1;
|
|
6508
6517
|
var PROVEN = 2;
|
|
6509
|
-
function isRecursive(inst, stack,
|
|
6518
|
+
function isRecursive(inst, stack, resolve4) {
|
|
6510
6519
|
const cached2 = recursive.get(inst);
|
|
6511
6520
|
if (cached2 !== void 0)
|
|
6512
6521
|
return cached2 ? PROVEN : NONE;
|
|
@@ -6516,7 +6525,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
6516
6525
|
let result = NONE;
|
|
6517
6526
|
const check2 = (child) => {
|
|
6518
6527
|
if (result !== PROVEN && child?._zod) {
|
|
6519
|
-
const answer = isRecursive(child, stack,
|
|
6528
|
+
const answer = isRecursive(child, stack, resolve4);
|
|
6520
6529
|
if (answer > result)
|
|
6521
6530
|
result = answer;
|
|
6522
6531
|
}
|
|
@@ -6527,7 +6536,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
6527
6536
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
6528
6537
|
if (spread && !desc.enumerable)
|
|
6529
6538
|
continue;
|
|
6530
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
6539
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve4) : NONE;
|
|
6531
6540
|
if (child > answer)
|
|
6532
6541
|
answer = child;
|
|
6533
6542
|
}
|
|
@@ -6591,7 +6600,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
6591
6600
|
break;
|
|
6592
6601
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
6593
6602
|
case "lazy": {
|
|
6594
|
-
const inner = def._cachedInner ?? (
|
|
6603
|
+
const inner = def._cachedInner ?? (resolve4 ? inst._zod.innerType : void 0);
|
|
6595
6604
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
6596
6605
|
break;
|
|
6597
6606
|
}
|
|
@@ -23255,11 +23264,11 @@ var Connection = class {
|
|
|
23255
23264
|
const id = this.nextRequestId++;
|
|
23256
23265
|
let cancel = () => {
|
|
23257
23266
|
};
|
|
23258
|
-
const response = new Promise((
|
|
23267
|
+
const response = new Promise((resolve4, reject) => {
|
|
23259
23268
|
const pendingResponse = {
|
|
23260
23269
|
resolve: (value) => {
|
|
23261
23270
|
try {
|
|
23262
|
-
|
|
23271
|
+
resolve4(mapResponse ? mapResponse(value) : value);
|
|
23263
23272
|
} catch (error62) {
|
|
23264
23273
|
reject(error62);
|
|
23265
23274
|
}
|
|
@@ -23316,8 +23325,8 @@ var Connection = class {
|
|
|
23316
23325
|
this.stream = stream;
|
|
23317
23326
|
this.staticHandlers = handlers;
|
|
23318
23327
|
this.allowBatches = options?.allowBatches ?? true;
|
|
23319
|
-
this.closedPromise = new Promise((
|
|
23320
|
-
this.abortController.signal.addEventListener("abort", () =>
|
|
23328
|
+
this.closedPromise = new Promise((resolve4) => {
|
|
23329
|
+
this.abortController.signal.addEventListener("abort", () => resolve4());
|
|
23321
23330
|
});
|
|
23322
23331
|
void this.receive();
|
|
23323
23332
|
}
|
|
@@ -24211,8 +24220,8 @@ var AsyncQueue = class {
|
|
|
24211
24220
|
if (this.failed) {
|
|
24212
24221
|
return Promise.reject(this.failure);
|
|
24213
24222
|
}
|
|
24214
|
-
return new Promise((
|
|
24215
|
-
this.waiters.push({ resolve:
|
|
24223
|
+
return new Promise((resolve4, reject) => {
|
|
24224
|
+
this.waiters.push({ resolve: resolve4, reject });
|
|
24216
24225
|
});
|
|
24217
24226
|
}
|
|
24218
24227
|
};
|
|
@@ -25256,12 +25265,12 @@ function createAcpConnection(options) {
|
|
|
25256
25265
|
failIfClosed();
|
|
25257
25266
|
const id = nextRequestId;
|
|
25258
25267
|
nextRequestId += 1;
|
|
25259
|
-
const { promise: promise2, resolve:
|
|
25268
|
+
const { promise: promise2, resolve: resolve4, reject } = Promise.withResolvers();
|
|
25260
25269
|
pending.set(String(id), {
|
|
25261
25270
|
method,
|
|
25262
25271
|
...promptId === void 0 ? {} : { promptId },
|
|
25263
25272
|
...onArrival === void 0 ? {} : { onArrival },
|
|
25264
|
-
resolve:
|
|
25273
|
+
resolve: resolve4,
|
|
25265
25274
|
reject
|
|
25266
25275
|
});
|
|
25267
25276
|
const message = params === void 0 ? { jsonrpc: "2.0", id, method } : { jsonrpc: "2.0", id, method, params };
|
|
@@ -25290,8 +25299,8 @@ function createAcpConnection(options) {
|
|
|
25290
25299
|
if (inboundBatches === 0) {
|
|
25291
25300
|
return;
|
|
25292
25301
|
}
|
|
25293
|
-
await new Promise((
|
|
25294
|
-
idleWaiters.push(
|
|
25302
|
+
await new Promise((resolve4) => {
|
|
25303
|
+
idleWaiters.push(resolve4);
|
|
25295
25304
|
if (inboundBatches === 0) {
|
|
25296
25305
|
releaseIdleWaiters();
|
|
25297
25306
|
}
|
|
@@ -25376,8 +25385,8 @@ var Mutex = class {
|
|
|
25376
25385
|
this.locked = true;
|
|
25377
25386
|
return Promise.resolve();
|
|
25378
25387
|
}
|
|
25379
|
-
return new Promise((
|
|
25380
|
-
this.waiters.push(
|
|
25388
|
+
return new Promise((resolve4) => {
|
|
25389
|
+
this.waiters.push(resolve4);
|
|
25381
25390
|
});
|
|
25382
25391
|
}
|
|
25383
25392
|
tryAcquire() {
|
|
@@ -25577,9 +25586,9 @@ function createExecutorLifecycle({
|
|
|
25577
25586
|
let timer;
|
|
25578
25587
|
await Promise.race([
|
|
25579
25588
|
connection.closed.catch(() => void 0),
|
|
25580
|
-
new Promise((
|
|
25589
|
+
new Promise((resolve4) => {
|
|
25581
25590
|
timer = setTimeout(
|
|
25582
|
-
|
|
25591
|
+
resolve4,
|
|
25583
25592
|
options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
|
|
25584
25593
|
);
|
|
25585
25594
|
})
|
|
@@ -26056,6 +26065,7 @@ function createExecutorPrompt({
|
|
|
26056
26065
|
promptResults,
|
|
26057
26066
|
settleToolSubagents
|
|
26058
26067
|
}) {
|
|
26068
|
+
const ownOutcomes = /* @__PURE__ */ new Map();
|
|
26059
26069
|
const settleTurn = (input2) => {
|
|
26060
26070
|
if (!isLive(input2.expectedGeneration) || input2.record.finished) {
|
|
26061
26071
|
return false;
|
|
@@ -26072,14 +26082,22 @@ function createExecutorPrompt({
|
|
|
26072
26082
|
}
|
|
26073
26083
|
closeActiveAssistantSegment(input2.turnId);
|
|
26074
26084
|
shared.promptsInFlight = Math.max(0, shared.promptsInFlight - 1);
|
|
26075
|
-
if (shared.promptsInFlight !== 0 || shared.activeTurnId !== input2.turnId)
|
|
26085
|
+
if (shared.promptsInFlight !== 0 || shared.activeTurnId !== input2.turnId) {
|
|
26086
|
+
if (input2.foldedIn !== true) ownOutcomes.set(input2.turnId, input2);
|
|
26087
|
+
return false;
|
|
26088
|
+
}
|
|
26089
|
+
const outcome = (input2.foldedIn === true ? ownOutcomes.get(input2.turnId) : void 0) ?? input2;
|
|
26090
|
+
ownOutcomes.delete(input2.turnId);
|
|
26076
26091
|
shared.activeTurnId = void 0;
|
|
26077
26092
|
if (shared.status !== "disposed") {
|
|
26078
26093
|
shared.status = "ready";
|
|
26079
26094
|
}
|
|
26080
26095
|
const interrupted = promptResults.hasInterrupted(input2.turnId);
|
|
26081
26096
|
settleToolSubagents(
|
|
26082
|
-
toolSubagentSettlementOfTurn(
|
|
26097
|
+
toolSubagentSettlementOfTurn(
|
|
26098
|
+
interrupted ? "cancelled" : outcome.state,
|
|
26099
|
+
outcome.failureCategory
|
|
26100
|
+
),
|
|
26083
26101
|
input2.turnId
|
|
26084
26102
|
);
|
|
26085
26103
|
emit({
|
|
@@ -26089,10 +26107,10 @@ function createExecutorPrompt({
|
|
|
26089
26107
|
threadId: options.threadId,
|
|
26090
26108
|
turnId: input2.turnId,
|
|
26091
26109
|
payload: {
|
|
26092
|
-
state: interrupted ? "cancelled" :
|
|
26093
|
-
stopReason: interrupted ? "cancelled" :
|
|
26094
|
-
...
|
|
26095
|
-
...
|
|
26110
|
+
state: interrupted ? "cancelled" : outcome.state,
|
|
26111
|
+
stopReason: interrupted ? "cancelled" : outcome.stopReason,
|
|
26112
|
+
...outcome.errorMessage === void 0 ? {} : { errorMessage: outcome.errorMessage },
|
|
26113
|
+
...outcome.state === "failed" ? failureCategoryField(outcome.failureCategory) : {}
|
|
26096
26114
|
}
|
|
26097
26115
|
});
|
|
26098
26116
|
interruptedTurnIds.delete(input2.turnId);
|
|
@@ -26117,7 +26135,7 @@ function createExecutorPrompt({
|
|
|
26117
26135
|
return await promptRpc;
|
|
26118
26136
|
} else {
|
|
26119
26137
|
const { promise: early, resolve: settleEarly } = Promise.withResolvers();
|
|
26120
|
-
shared.
|
|
26138
|
+
shared.pendingSettlements.set(promptKey, {
|
|
26121
26139
|
promptKey,
|
|
26122
26140
|
sessionId,
|
|
26123
26141
|
settle: settleEarly,
|
|
@@ -26126,7 +26144,7 @@ function createExecutorPrompt({
|
|
|
26126
26144
|
onError: () => promptResults.reject(record2.promptId),
|
|
26127
26145
|
hasResult: () => record2.response !== void 0
|
|
26128
26146
|
}
|
|
26129
|
-
};
|
|
26147
|
+
});
|
|
26130
26148
|
try {
|
|
26131
26149
|
const outcome = await Promise.race([
|
|
26132
26150
|
promptRpc.then((value) => {
|
|
@@ -26139,7 +26157,7 @@ function createExecutorPrompt({
|
|
|
26139
26157
|
if (outcome.error !== void 0) throw outcome.error;
|
|
26140
26158
|
return outcome.response;
|
|
26141
26159
|
} finally {
|
|
26142
|
-
shared.
|
|
26160
|
+
shared.pendingSettlements.delete(promptKey);
|
|
26143
26161
|
void promptRpc.catch(() => void 0);
|
|
26144
26162
|
}
|
|
26145
26163
|
}
|
|
@@ -26289,7 +26307,9 @@ function createExecutorPrompt({
|
|
|
26289
26307
|
settle2({
|
|
26290
26308
|
turnId,
|
|
26291
26309
|
stopReason,
|
|
26292
|
-
state: response2.stopReason === "cancelled" ? "cancelled" : "completed"
|
|
26310
|
+
state: response2.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
26311
|
+
// 立刻写出的插话没被打断却应答 cancelled:agent 把它并进了这一轮(grok 的 removedFromQueue)。
|
|
26312
|
+
foldedIn: response2.stopReason === "cancelled" && input2.expectedActiveTurnId !== void 0 && hooks.queuesPromptsWhileRunning === true
|
|
26293
26313
|
});
|
|
26294
26314
|
return {
|
|
26295
26315
|
threadId: options.threadId,
|
|
@@ -26298,7 +26318,8 @@ function createExecutorPrompt({
|
|
|
26298
26318
|
...response2.usage !== void 0 && response2.usage !== null ? { usage: response2.usage } : {}
|
|
26299
26319
|
};
|
|
26300
26320
|
};
|
|
26301
|
-
|
|
26321
|
+
const writesWhileRunning = input2.expectedActiveTurnId !== void 0 && hooks.queuesPromptsWhileRunning === true;
|
|
26322
|
+
if (!writesWhileRunning) await promptMutex.acquire();
|
|
26302
26323
|
let response;
|
|
26303
26324
|
try {
|
|
26304
26325
|
failIfDisposed();
|
|
@@ -26380,7 +26401,7 @@ function createExecutorPrompt({
|
|
|
26380
26401
|
await options.beforeApplyResult();
|
|
26381
26402
|
}
|
|
26382
26403
|
} finally {
|
|
26383
|
-
promptMutex.release();
|
|
26404
|
+
if (!writesWhileRunning) promptMutex.release();
|
|
26384
26405
|
notifyPromptSettled();
|
|
26385
26406
|
}
|
|
26386
26407
|
if (!isLive(started.generation)) {
|
|
@@ -26424,12 +26445,12 @@ function createPromptResults({
|
|
|
26424
26445
|
}) {
|
|
26425
26446
|
const prompts = /* @__PURE__ */ new Map();
|
|
26426
26447
|
const add = (identity, finish) => {
|
|
26427
|
-
const { promise: done, resolve:
|
|
26448
|
+
const { promise: done, resolve: resolve4 } = Promise.withResolvers();
|
|
26428
26449
|
const record2 = {
|
|
26429
26450
|
...identity,
|
|
26430
26451
|
finish,
|
|
26431
26452
|
done,
|
|
26432
|
-
resolve:
|
|
26453
|
+
resolve: resolve4,
|
|
26433
26454
|
rejected: false,
|
|
26434
26455
|
interrupted: false,
|
|
26435
26456
|
finished: false
|
|
@@ -26477,9 +26498,9 @@ function createPromptResults({
|
|
|
26477
26498
|
try {
|
|
26478
26499
|
const drained = await Promise.race([
|
|
26479
26500
|
Promise.all(claimed.map((record2) => record2.done)).then(() => true),
|
|
26480
|
-
new Promise((
|
|
26501
|
+
new Promise((resolve4) => {
|
|
26481
26502
|
timer = setTimeout(
|
|
26482
|
-
() =>
|
|
26503
|
+
() => resolve4(false),
|
|
26483
26504
|
options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
|
|
26484
26505
|
);
|
|
26485
26506
|
})
|
|
@@ -26639,14 +26660,14 @@ function createExecutorRequests({
|
|
|
26639
26660
|
}
|
|
26640
26661
|
}
|
|
26641
26662
|
const requestId = randomId();
|
|
26642
|
-
const outcome = await new Promise((
|
|
26663
|
+
const outcome = await new Promise((resolve4) => {
|
|
26643
26664
|
const pending = {
|
|
26644
26665
|
requestId,
|
|
26645
26666
|
request: params,
|
|
26646
26667
|
permissionRequest,
|
|
26647
26668
|
turnId: shared.activeTurnId,
|
|
26648
26669
|
settled: false,
|
|
26649
|
-
resolve:
|
|
26670
|
+
resolve: resolve4
|
|
26650
26671
|
};
|
|
26651
26672
|
approvals.add(pending);
|
|
26652
26673
|
emit(
|
|
@@ -26864,14 +26885,14 @@ function createExecutorRuntime({
|
|
|
26864
26885
|
if (!promptMutex.isLocked) {
|
|
26865
26886
|
return true;
|
|
26866
26887
|
}
|
|
26867
|
-
return await new Promise((
|
|
26888
|
+
return await new Promise((resolve4) => {
|
|
26868
26889
|
const timer = setTimeout(() => {
|
|
26869
26890
|
shared.promptWaiters = shared.promptWaiters.filter((waiter) => waiter !== onSettle);
|
|
26870
|
-
|
|
26891
|
+
resolve4(false);
|
|
26871
26892
|
}, timeoutMs);
|
|
26872
26893
|
const onSettle = () => {
|
|
26873
26894
|
clearTimeout(timer);
|
|
26874
|
-
|
|
26895
|
+
resolve4(true);
|
|
26875
26896
|
};
|
|
26876
26897
|
shared.promptWaiters.push(onSettle);
|
|
26877
26898
|
});
|
|
@@ -27441,28 +27462,29 @@ function createExecutorSettlement({
|
|
|
27441
27462
|
if (settledPromptKeys.length > SETTLED_PROMPT_KEY_LIMIT) settledPromptKeys.shift();
|
|
27442
27463
|
};
|
|
27443
27464
|
const abortPendingSettlement = (reason, failureCategory) => {
|
|
27444
|
-
const waiting
|
|
27445
|
-
|
|
27446
|
-
|
|
27447
|
-
|
|
27448
|
-
|
|
27449
|
-
|
|
27450
|
-
|
|
27451
|
-
|
|
27452
|
-
)
|
|
27453
|
-
}
|
|
27465
|
+
for (const [key, waiting] of shared.pendingSettlements) {
|
|
27466
|
+
if (waiting.hasResult?.()) continue;
|
|
27467
|
+
shared.pendingSettlements.delete(key);
|
|
27468
|
+
waiting.settle({
|
|
27469
|
+
error: withFailureCategory(
|
|
27470
|
+
new AcpExecutorRequestError("session/prompt", reason),
|
|
27471
|
+
failureCategory
|
|
27472
|
+
)
|
|
27473
|
+
});
|
|
27474
|
+
}
|
|
27454
27475
|
};
|
|
27455
27476
|
const settleFromNotification = (method, params) => {
|
|
27456
27477
|
const hook = hooks.promptSettlement;
|
|
27457
|
-
if (hook === void 0 || shared.
|
|
27478
|
+
if (hook === void 0 || shared.pendingSettlements.size === 0) return false;
|
|
27458
27479
|
const signal = hook.fromNotification(method, params);
|
|
27459
27480
|
if (signal === void 0) return false;
|
|
27460
|
-
const waiting = shared.
|
|
27461
|
-
|
|
27462
|
-
|
|
27463
|
-
|
|
27481
|
+
const waiting = signal.promptKey === void 0 ? [...shared.pendingSettlements.values()].find(
|
|
27482
|
+
(candidate) => candidate.sessionId === signal.sessionId
|
|
27483
|
+
) : shared.pendingSettlements.get(signal.promptKey);
|
|
27484
|
+
if (waiting === void 0 || waiting.sessionId !== signal.sessionId) {
|
|
27485
|
+
return signal.promptKey !== void 0 && settledPromptKeys.includes(signal.promptKey);
|
|
27464
27486
|
}
|
|
27465
|
-
shared.
|
|
27487
|
+
shared.pendingSettlements.delete(waiting.promptKey);
|
|
27466
27488
|
rememberSettledPromptKey(waiting.promptKey);
|
|
27467
27489
|
if (signal.outcome === "error") {
|
|
27468
27490
|
waiting.onError?.();
|
|
@@ -28056,7 +28078,7 @@ function createAcpExecutor(options) {
|
|
|
28056
28078
|
startInFlight: void 0,
|
|
28057
28079
|
activeTurnId: void 0,
|
|
28058
28080
|
promptsInFlight: 0,
|
|
28059
|
-
|
|
28081
|
+
pendingSettlements: /* @__PURE__ */ new Map(),
|
|
28060
28082
|
manualCompaction: void 0,
|
|
28061
28083
|
assistantSegment: { nextSegmentIndex: 0 },
|
|
28062
28084
|
modeState: void 0,
|
|
@@ -28442,13 +28464,13 @@ function acpNativeSessionProcessMatcher(program, args) {
|
|
|
28442
28464
|
|
|
28443
28465
|
// ../../packages/ycodium-acp-executor/src/prompt-dispatch.ts
|
|
28444
28466
|
var dispatchAcpPrompt = (executor, input2) => {
|
|
28445
|
-
const { promise: dispatched, resolve:
|
|
28467
|
+
const { promise: dispatched, resolve: resolve4 } = Promise.withResolvers();
|
|
28446
28468
|
let written = false;
|
|
28447
28469
|
const finished = executor.prompt({
|
|
28448
28470
|
...input2,
|
|
28449
28471
|
onDispatched: (turnId) => {
|
|
28450
28472
|
written = true;
|
|
28451
|
-
|
|
28473
|
+
resolve4(turnId);
|
|
28452
28474
|
}
|
|
28453
28475
|
});
|
|
28454
28476
|
return Promise.race([
|
|
@@ -29494,8 +29516,8 @@ var kimiToolSubagents = {
|
|
|
29494
29516
|
// src/kimiInstance.ts
|
|
29495
29517
|
var RESUME_SCHEMA_VERSION = 1;
|
|
29496
29518
|
var CLIENT_INFO = { name: "ycodium-agent-kimi", version: "0.1.0" };
|
|
29497
|
-
var yieldTick = () => new Promise((
|
|
29498
|
-
setImmediate(
|
|
29519
|
+
var yieldTick = () => new Promise((resolve4) => {
|
|
29520
|
+
setImmediate(resolve4);
|
|
29499
29521
|
});
|
|
29500
29522
|
var EventBus = class {
|
|
29501
29523
|
#queued = [];
|
|
@@ -29522,8 +29544,8 @@ var EventBus = class {
|
|
|
29522
29544
|
const queued = this.#queued.shift();
|
|
29523
29545
|
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
29524
29546
|
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
29525
|
-
return new Promise((
|
|
29526
|
-
this.#waiters.push(
|
|
29547
|
+
return new Promise((resolve4) => {
|
|
29548
|
+
this.#waiters.push(resolve4);
|
|
29527
29549
|
});
|
|
29528
29550
|
}
|
|
29529
29551
|
};
|
|
@@ -29912,6 +29934,7 @@ var createKimiInstance = (config2, host) => {
|
|
|
29912
29934
|
var executors = [
|
|
29913
29935
|
{
|
|
29914
29936
|
card: KIMI_CARD,
|
|
29937
|
+
lifecycle: [{ kind: "detect", reversible: true }],
|
|
29915
29938
|
createInstance: async (config2, host) => {
|
|
29916
29939
|
host.log.info("createInstance");
|
|
29917
29940
|
return createKimiInstance(config2, host);
|
|
@@ -29920,9 +29943,26 @@ var executors = [
|
|
|
29920
29943
|
];
|
|
29921
29944
|
var index_default = definePlugin({
|
|
29922
29945
|
id: "agent-kimi",
|
|
29923
|
-
apiVersion:
|
|
29946
|
+
apiVersion: 60,
|
|
29924
29947
|
executors,
|
|
29925
29948
|
activate(ctx) {
|
|
29949
|
+
ctx.command({
|
|
29950
|
+
name: "effectiveConfig",
|
|
29951
|
+
description: "Settings form: the account directory an empty path resolves to on this machine.",
|
|
29952
|
+
scope: "read",
|
|
29953
|
+
payloadSchema: EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
29954
|
+
handle: async (payload) => {
|
|
29955
|
+
const request = readExecutorEffectiveRequest(payload);
|
|
29956
|
+
return {
|
|
29957
|
+
homePath: executorHomeEffectiveValue(
|
|
29958
|
+
"KIMI_CODE_HOME",
|
|
29959
|
+
request,
|
|
29960
|
+
process.env,
|
|
29961
|
+
(value) => value === void 0 ? NodePath8.join(NodeOS6.homedir(), ".kimi-code") : NodePath8.resolve(expandHomePath(value))
|
|
29962
|
+
)
|
|
29963
|
+
};
|
|
29964
|
+
}
|
|
29965
|
+
});
|
|
29926
29966
|
ctx.log.info("Kimi Code executor ready");
|
|
29927
29967
|
}
|
|
29928
29968
|
});
|
package/locales/en.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"presentation": {
|
|
3
|
+
"name": "Kimi Code",
|
|
4
|
+
"description": "Use Kimi Code in Ycodium, signed in with your Kimi account."
|
|
5
|
+
},
|
|
2
6
|
"form": {
|
|
3
7
|
"binaryPath": {
|
|
4
8
|
"title": "Program path",
|
|
@@ -9,6 +13,11 @@
|
|
|
9
13
|
"title": "Account directory",
|
|
10
14
|
"description": "Sessions and the `kimi login` credentials live here, so providers sharing this directory can pick up each other's threads and providers with different directories cannot. Leave empty to use the CLI's default.",
|
|
11
15
|
"placeholder": "e.g. ~/.kimi-code-work"
|
|
16
|
+
},
|
|
17
|
+
"effective": {
|
|
18
|
+
"provider": "{{name}} in this provider",
|
|
19
|
+
"machine": "{{name}} on this machine",
|
|
20
|
+
"default": "default"
|
|
12
21
|
}
|
|
13
22
|
},
|
|
14
23
|
"usage": {
|
package/locales/zh-CN.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"presentation": {
|
|
3
|
+
"name": "Kimi Code",
|
|
4
|
+
"description": "在 Ycodium 里使用 Kimi Code,用你的 Kimi 账号登录。"
|
|
5
|
+
},
|
|
2
6
|
"form": {
|
|
3
7
|
"binaryPath": {
|
|
4
8
|
"title": "程序路径",
|
|
@@ -9,6 +13,11 @@
|
|
|
9
13
|
"title": "账号目录",
|
|
10
14
|
"description": "会话和 `kimi login` 的凭据都保存在这里,因此共用同一目录的 provider 可以接手彼此的会话,目录不同的则不能。留空则使用该命令行工具的默认目录。",
|
|
11
15
|
"placeholder": "例如 ~/.kimi-code-work"
|
|
16
|
+
},
|
|
17
|
+
"effective": {
|
|
18
|
+
"provider": "本 provider 的 {{name}}",
|
|
19
|
+
"machine": "本机的 {{name}}",
|
|
20
|
+
"default": "默认"
|
|
12
21
|
}
|
|
13
22
|
},
|
|
14
23
|
"usage": {
|
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.3799",
|
|
4
4
|
"description": "Kimi Code executor: runs `kimi acp` over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -21,14 +21,16 @@
|
|
|
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.
|
|
24
|
+
"@ycodium-ai/plugin-api": "0.2.3799",
|
|
25
25
|
"ycodium-executor-testing": "0.0.0",
|
|
26
|
-
"ycodium-acp-executor": "0.2.
|
|
26
|
+
"ycodium-acp-executor": "0.2.3799"
|
|
27
27
|
},
|
|
28
28
|
"ycodium": {
|
|
29
29
|
"plugin": "./dist/index.js",
|
|
30
30
|
"displayName": "Kimi Code",
|
|
31
|
-
"
|
|
31
|
+
"displayNameKey": "presentation.name",
|
|
32
|
+
"description": "Use Kimi Code in Ycodium, signed in with your Kimi account.",
|
|
33
|
+
"descriptionKey": "presentation.description",
|
|
32
34
|
"icon": "./assets/icon.svg",
|
|
33
35
|
"permissions": [
|
|
34
36
|
{
|