@ycodium-ai/agent-dsh 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/assets/ICON-LICENSE +28 -0
- package/dist/index.js +107 -67
- package/locales/en.json +9 -0
- package/locales/zh-CN.json +9 -0
- package/package.json +7 -5
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
icon.svg in this directory uses the path geometry of the DeepSeek Mono
|
|
2
|
+
variant in @lobehub/icons 5.18.0, part of Lobe Icons
|
|
3
|
+
(https://github.com/lobehub/lobe-icons). DeepSeek is a trademark of its
|
|
4
|
+
owner.
|
|
5
|
+
|
|
6
|
+
The Lobe Icons license follows.
|
|
7
|
+
|
|
8
|
+
MIT License
|
|
9
|
+
|
|
10
|
+
Copyright (c) 2023 LobeHub
|
|
11
|
+
|
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
14
|
+
in the Software without restriction, including without limitation the rights
|
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
17
|
+
furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
|
20
|
+
copies or substantial portions of the Software.
|
|
21
|
+
|
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
28
|
+
SOFTWARE.
|
package/dist/index.js
CHANGED
|
@@ -7369,6 +7369,13 @@ var require_dist = __commonJS({
|
|
|
7369
7369
|
|
|
7370
7370
|
// src/index.ts
|
|
7371
7371
|
import { definePlugin } from "@ycodium-ai/plugin-api";
|
|
7372
|
+
import * as NodeOS6 from "node:os";
|
|
7373
|
+
import * as NodePath7 from "node:path";
|
|
7374
|
+
import {
|
|
7375
|
+
EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
7376
|
+
executorHomeEffectiveValue,
|
|
7377
|
+
readExecutorEffectiveRequest
|
|
7378
|
+
} from "@ycodium-ai/plugin-api/executor";
|
|
7372
7379
|
|
|
7373
7380
|
// src/card.ts
|
|
7374
7381
|
var DSH_DRIVER_KIND = "dsh";
|
|
@@ -7382,6 +7389,8 @@ var DSH_CARD = {
|
|
|
7382
7389
|
// 宿主旧实现把它写死在 DshAcpSupport,这里落在名片上)。
|
|
7383
7390
|
launchArgs: "--profile acp",
|
|
7384
7391
|
homeEnvVar: "DSH_HOME",
|
|
7392
|
+
// 设置表单里留空的格子此刻会用什么,见 index.ts 的同名命令。
|
|
7393
|
+
effectiveCommand: "effectiveConfig",
|
|
7385
7394
|
environment: [{ name: "DEEPSEEK_API_KEY", sensitive: true }],
|
|
7386
7395
|
install: { kind: "npm" },
|
|
7387
7396
|
// 凭据从环境读,没有登录命令可跑,更没有设备码流程——signIn 这一项不实现。
|
|
@@ -7692,8 +7701,8 @@ var UnboundedEventStream = class {
|
|
|
7692
7701
|
iterators.subscribers.delete(subscriber);
|
|
7693
7702
|
return { value: void 0, done: true };
|
|
7694
7703
|
}
|
|
7695
|
-
await new Promise((
|
|
7696
|
-
subscriber.wake =
|
|
7704
|
+
await new Promise((resolve4) => {
|
|
7705
|
+
subscriber.wake = resolve4;
|
|
7697
7706
|
});
|
|
7698
7707
|
}
|
|
7699
7708
|
},
|
|
@@ -13912,7 +13921,7 @@ var recursive = /* @__PURE__ */ new WeakMap();
|
|
|
13912
13921
|
var NONE = 0;
|
|
13913
13922
|
var ASSUMED = 1;
|
|
13914
13923
|
var PROVEN = 2;
|
|
13915
|
-
function isRecursive(inst, stack,
|
|
13924
|
+
function isRecursive(inst, stack, resolve4) {
|
|
13916
13925
|
const cached2 = recursive.get(inst);
|
|
13917
13926
|
if (cached2 !== void 0)
|
|
13918
13927
|
return cached2 ? PROVEN : NONE;
|
|
@@ -13922,7 +13931,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
13922
13931
|
let result = NONE;
|
|
13923
13932
|
const check2 = (child) => {
|
|
13924
13933
|
if (result !== PROVEN && child?._zod) {
|
|
13925
|
-
const answer = isRecursive(child, stack,
|
|
13934
|
+
const answer = isRecursive(child, stack, resolve4);
|
|
13926
13935
|
if (answer > result)
|
|
13927
13936
|
result = answer;
|
|
13928
13937
|
}
|
|
@@ -13933,7 +13942,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
13933
13942
|
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
13934
13943
|
if (spread && !desc.enumerable)
|
|
13935
13944
|
continue;
|
|
13936
|
-
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack,
|
|
13945
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve4) : NONE;
|
|
13937
13946
|
if (child > answer)
|
|
13938
13947
|
answer = child;
|
|
13939
13948
|
}
|
|
@@ -13997,7 +14006,7 @@ function isRecursive(inst, stack, resolve3) {
|
|
|
13997
14006
|
break;
|
|
13998
14007
|
// `$ZodLazy` caches its inner on the def, so a resolved edge is followed exactly
|
|
13999
14008
|
case "lazy": {
|
|
14000
|
-
const inner = def._cachedInner ?? (
|
|
14009
|
+
const inner = def._cachedInner ?? (resolve4 ? inst._zod.innerType : void 0);
|
|
14001
14010
|
merge2(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
14002
14011
|
break;
|
|
14003
14012
|
}
|
|
@@ -30661,11 +30670,11 @@ var Connection = class {
|
|
|
30661
30670
|
const id = this.nextRequestId++;
|
|
30662
30671
|
let cancel = () => {
|
|
30663
30672
|
};
|
|
30664
|
-
const response = new Promise((
|
|
30673
|
+
const response = new Promise((resolve4, reject) => {
|
|
30665
30674
|
const pendingResponse = {
|
|
30666
30675
|
resolve: (value) => {
|
|
30667
30676
|
try {
|
|
30668
|
-
|
|
30677
|
+
resolve4(mapResponse ? mapResponse(value) : value);
|
|
30669
30678
|
} catch (error62) {
|
|
30670
30679
|
reject(error62);
|
|
30671
30680
|
}
|
|
@@ -30722,8 +30731,8 @@ var Connection = class {
|
|
|
30722
30731
|
this.stream = stream;
|
|
30723
30732
|
this.staticHandlers = handlers;
|
|
30724
30733
|
this.allowBatches = options?.allowBatches ?? true;
|
|
30725
|
-
this.closedPromise = new Promise((
|
|
30726
|
-
this.abortController.signal.addEventListener("abort", () =>
|
|
30734
|
+
this.closedPromise = new Promise((resolve4) => {
|
|
30735
|
+
this.abortController.signal.addEventListener("abort", () => resolve4());
|
|
30727
30736
|
});
|
|
30728
30737
|
void this.receive();
|
|
30729
30738
|
}
|
|
@@ -31617,8 +31626,8 @@ var AsyncQueue = class {
|
|
|
31617
31626
|
if (this.failed) {
|
|
31618
31627
|
return Promise.reject(this.failure);
|
|
31619
31628
|
}
|
|
31620
|
-
return new Promise((
|
|
31621
|
-
this.waiters.push({ resolve:
|
|
31629
|
+
return new Promise((resolve4, reject) => {
|
|
31630
|
+
this.waiters.push({ resolve: resolve4, reject });
|
|
31622
31631
|
});
|
|
31623
31632
|
}
|
|
31624
31633
|
};
|
|
@@ -32662,12 +32671,12 @@ function createAcpConnection(options) {
|
|
|
32662
32671
|
failIfClosed();
|
|
32663
32672
|
const id = nextRequestId;
|
|
32664
32673
|
nextRequestId += 1;
|
|
32665
|
-
const { promise: promise2, resolve:
|
|
32674
|
+
const { promise: promise2, resolve: resolve4, reject } = Promise.withResolvers();
|
|
32666
32675
|
pending.set(String(id), {
|
|
32667
32676
|
method,
|
|
32668
32677
|
...promptId === void 0 ? {} : { promptId },
|
|
32669
32678
|
...onArrival === void 0 ? {} : { onArrival },
|
|
32670
|
-
resolve:
|
|
32679
|
+
resolve: resolve4,
|
|
32671
32680
|
reject
|
|
32672
32681
|
});
|
|
32673
32682
|
const message = params === void 0 ? { jsonrpc: "2.0", id, method } : { jsonrpc: "2.0", id, method, params };
|
|
@@ -32696,8 +32705,8 @@ function createAcpConnection(options) {
|
|
|
32696
32705
|
if (inboundBatches === 0) {
|
|
32697
32706
|
return;
|
|
32698
32707
|
}
|
|
32699
|
-
await new Promise((
|
|
32700
|
-
idleWaiters.push(
|
|
32708
|
+
await new Promise((resolve4) => {
|
|
32709
|
+
idleWaiters.push(resolve4);
|
|
32701
32710
|
if (inboundBatches === 0) {
|
|
32702
32711
|
releaseIdleWaiters();
|
|
32703
32712
|
}
|
|
@@ -32782,8 +32791,8 @@ var Mutex = class {
|
|
|
32782
32791
|
this.locked = true;
|
|
32783
32792
|
return Promise.resolve();
|
|
32784
32793
|
}
|
|
32785
|
-
return new Promise((
|
|
32786
|
-
this.waiters.push(
|
|
32794
|
+
return new Promise((resolve4) => {
|
|
32795
|
+
this.waiters.push(resolve4);
|
|
32787
32796
|
});
|
|
32788
32797
|
}
|
|
32789
32798
|
tryAcquire() {
|
|
@@ -32983,9 +32992,9 @@ function createExecutorLifecycle({
|
|
|
32983
32992
|
let timer;
|
|
32984
32993
|
await Promise.race([
|
|
32985
32994
|
connection.closed.catch(() => void 0),
|
|
32986
|
-
new Promise((
|
|
32995
|
+
new Promise((resolve4) => {
|
|
32987
32996
|
timer = setTimeout(
|
|
32988
|
-
|
|
32997
|
+
resolve4,
|
|
32989
32998
|
options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
|
|
32990
32999
|
);
|
|
32991
33000
|
})
|
|
@@ -33462,6 +33471,7 @@ function createExecutorPrompt({
|
|
|
33462
33471
|
promptResults,
|
|
33463
33472
|
settleToolSubagents
|
|
33464
33473
|
}) {
|
|
33474
|
+
const ownOutcomes = /* @__PURE__ */ new Map();
|
|
33465
33475
|
const settleTurn = (input2) => {
|
|
33466
33476
|
if (!isLive(input2.expectedGeneration) || input2.record.finished) {
|
|
33467
33477
|
return false;
|
|
@@ -33478,14 +33488,22 @@ function createExecutorPrompt({
|
|
|
33478
33488
|
}
|
|
33479
33489
|
closeActiveAssistantSegment(input2.turnId);
|
|
33480
33490
|
shared.promptsInFlight = Math.max(0, shared.promptsInFlight - 1);
|
|
33481
|
-
if (shared.promptsInFlight !== 0 || shared.activeTurnId !== input2.turnId)
|
|
33491
|
+
if (shared.promptsInFlight !== 0 || shared.activeTurnId !== input2.turnId) {
|
|
33492
|
+
if (input2.foldedIn !== true) ownOutcomes.set(input2.turnId, input2);
|
|
33493
|
+
return false;
|
|
33494
|
+
}
|
|
33495
|
+
const outcome = (input2.foldedIn === true ? ownOutcomes.get(input2.turnId) : void 0) ?? input2;
|
|
33496
|
+
ownOutcomes.delete(input2.turnId);
|
|
33482
33497
|
shared.activeTurnId = void 0;
|
|
33483
33498
|
if (shared.status !== "disposed") {
|
|
33484
33499
|
shared.status = "ready";
|
|
33485
33500
|
}
|
|
33486
33501
|
const interrupted = promptResults.hasInterrupted(input2.turnId);
|
|
33487
33502
|
settleToolSubagents(
|
|
33488
|
-
toolSubagentSettlementOfTurn(
|
|
33503
|
+
toolSubagentSettlementOfTurn(
|
|
33504
|
+
interrupted ? "cancelled" : outcome.state,
|
|
33505
|
+
outcome.failureCategory
|
|
33506
|
+
),
|
|
33489
33507
|
input2.turnId
|
|
33490
33508
|
);
|
|
33491
33509
|
emit({
|
|
@@ -33495,10 +33513,10 @@ function createExecutorPrompt({
|
|
|
33495
33513
|
threadId: options.threadId,
|
|
33496
33514
|
turnId: input2.turnId,
|
|
33497
33515
|
payload: {
|
|
33498
|
-
state: interrupted ? "cancelled" :
|
|
33499
|
-
stopReason: interrupted ? "cancelled" :
|
|
33500
|
-
...
|
|
33501
|
-
...
|
|
33516
|
+
state: interrupted ? "cancelled" : outcome.state,
|
|
33517
|
+
stopReason: interrupted ? "cancelled" : outcome.stopReason,
|
|
33518
|
+
...outcome.errorMessage === void 0 ? {} : { errorMessage: outcome.errorMessage },
|
|
33519
|
+
...outcome.state === "failed" ? failureCategoryField(outcome.failureCategory) : {}
|
|
33502
33520
|
}
|
|
33503
33521
|
});
|
|
33504
33522
|
interruptedTurnIds.delete(input2.turnId);
|
|
@@ -33523,7 +33541,7 @@ function createExecutorPrompt({
|
|
|
33523
33541
|
return await promptRpc;
|
|
33524
33542
|
} else {
|
|
33525
33543
|
const { promise: early, resolve: settleEarly } = Promise.withResolvers();
|
|
33526
|
-
shared.
|
|
33544
|
+
shared.pendingSettlements.set(promptKey, {
|
|
33527
33545
|
promptKey,
|
|
33528
33546
|
sessionId,
|
|
33529
33547
|
settle: settleEarly,
|
|
@@ -33532,7 +33550,7 @@ function createExecutorPrompt({
|
|
|
33532
33550
|
onError: () => promptResults.reject(record2.promptId),
|
|
33533
33551
|
hasResult: () => record2.response !== void 0
|
|
33534
33552
|
}
|
|
33535
|
-
};
|
|
33553
|
+
});
|
|
33536
33554
|
try {
|
|
33537
33555
|
const outcome = await Promise.race([
|
|
33538
33556
|
promptRpc.then((value) => {
|
|
@@ -33545,7 +33563,7 @@ function createExecutorPrompt({
|
|
|
33545
33563
|
if (outcome.error !== void 0) throw outcome.error;
|
|
33546
33564
|
return outcome.response;
|
|
33547
33565
|
} finally {
|
|
33548
|
-
shared.
|
|
33566
|
+
shared.pendingSettlements.delete(promptKey);
|
|
33549
33567
|
void promptRpc.catch(() => void 0);
|
|
33550
33568
|
}
|
|
33551
33569
|
}
|
|
@@ -33695,7 +33713,9 @@ function createExecutorPrompt({
|
|
|
33695
33713
|
settle2({
|
|
33696
33714
|
turnId,
|
|
33697
33715
|
stopReason,
|
|
33698
|
-
state: response2.stopReason === "cancelled" ? "cancelled" : "completed"
|
|
33716
|
+
state: response2.stopReason === "cancelled" ? "cancelled" : "completed",
|
|
33717
|
+
// 立刻写出的插话没被打断却应答 cancelled:agent 把它并进了这一轮(grok 的 removedFromQueue)。
|
|
33718
|
+
foldedIn: response2.stopReason === "cancelled" && input2.expectedActiveTurnId !== void 0 && hooks.queuesPromptsWhileRunning === true
|
|
33699
33719
|
});
|
|
33700
33720
|
return {
|
|
33701
33721
|
threadId: options.threadId,
|
|
@@ -33704,7 +33724,8 @@ function createExecutorPrompt({
|
|
|
33704
33724
|
...response2.usage !== void 0 && response2.usage !== null ? { usage: response2.usage } : {}
|
|
33705
33725
|
};
|
|
33706
33726
|
};
|
|
33707
|
-
|
|
33727
|
+
const writesWhileRunning = input2.expectedActiveTurnId !== void 0 && hooks.queuesPromptsWhileRunning === true;
|
|
33728
|
+
if (!writesWhileRunning) await promptMutex.acquire();
|
|
33708
33729
|
let response;
|
|
33709
33730
|
try {
|
|
33710
33731
|
failIfDisposed();
|
|
@@ -33786,7 +33807,7 @@ function createExecutorPrompt({
|
|
|
33786
33807
|
await options.beforeApplyResult();
|
|
33787
33808
|
}
|
|
33788
33809
|
} finally {
|
|
33789
|
-
promptMutex.release();
|
|
33810
|
+
if (!writesWhileRunning) promptMutex.release();
|
|
33790
33811
|
notifyPromptSettled();
|
|
33791
33812
|
}
|
|
33792
33813
|
if (!isLive(started.generation)) {
|
|
@@ -33830,12 +33851,12 @@ function createPromptResults({
|
|
|
33830
33851
|
}) {
|
|
33831
33852
|
const prompts = /* @__PURE__ */ new Map();
|
|
33832
33853
|
const add = (identity, finish) => {
|
|
33833
|
-
const { promise: done, resolve:
|
|
33854
|
+
const { promise: done, resolve: resolve4 } = Promise.withResolvers();
|
|
33834
33855
|
const record2 = {
|
|
33835
33856
|
...identity,
|
|
33836
33857
|
finish,
|
|
33837
33858
|
done,
|
|
33838
|
-
resolve:
|
|
33859
|
+
resolve: resolve4,
|
|
33839
33860
|
rejected: false,
|
|
33840
33861
|
interrupted: false,
|
|
33841
33862
|
finished: false
|
|
@@ -33883,9 +33904,9 @@ function createPromptResults({
|
|
|
33883
33904
|
try {
|
|
33884
33905
|
const drained = await Promise.race([
|
|
33885
33906
|
Promise.all(claimed.map((record2) => record2.done)).then(() => true),
|
|
33886
|
-
new Promise((
|
|
33907
|
+
new Promise((resolve4) => {
|
|
33887
33908
|
timer = setTimeout(
|
|
33888
|
-
() =>
|
|
33909
|
+
() => resolve4(false),
|
|
33889
33910
|
options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
|
|
33890
33911
|
);
|
|
33891
33912
|
})
|
|
@@ -34045,14 +34066,14 @@ function createExecutorRequests({
|
|
|
34045
34066
|
}
|
|
34046
34067
|
}
|
|
34047
34068
|
const requestId = randomId();
|
|
34048
|
-
const outcome = await new Promise((
|
|
34069
|
+
const outcome = await new Promise((resolve4) => {
|
|
34049
34070
|
const pending = {
|
|
34050
34071
|
requestId,
|
|
34051
34072
|
request: params,
|
|
34052
34073
|
permissionRequest,
|
|
34053
34074
|
turnId: shared.activeTurnId,
|
|
34054
34075
|
settled: false,
|
|
34055
|
-
resolve:
|
|
34076
|
+
resolve: resolve4
|
|
34056
34077
|
};
|
|
34057
34078
|
approvals.add(pending);
|
|
34058
34079
|
emit(
|
|
@@ -34270,14 +34291,14 @@ function createExecutorRuntime({
|
|
|
34270
34291
|
if (!promptMutex.isLocked) {
|
|
34271
34292
|
return true;
|
|
34272
34293
|
}
|
|
34273
|
-
return await new Promise((
|
|
34294
|
+
return await new Promise((resolve4) => {
|
|
34274
34295
|
const timer = setTimeout(() => {
|
|
34275
34296
|
shared.promptWaiters = shared.promptWaiters.filter((waiter) => waiter !== onSettle);
|
|
34276
|
-
|
|
34297
|
+
resolve4(false);
|
|
34277
34298
|
}, timeoutMs);
|
|
34278
34299
|
const onSettle = () => {
|
|
34279
34300
|
clearTimeout(timer);
|
|
34280
|
-
|
|
34301
|
+
resolve4(true);
|
|
34281
34302
|
};
|
|
34282
34303
|
shared.promptWaiters.push(onSettle);
|
|
34283
34304
|
});
|
|
@@ -34829,28 +34850,29 @@ function createExecutorSettlement({
|
|
|
34829
34850
|
if (settledPromptKeys.length > SETTLED_PROMPT_KEY_LIMIT) settledPromptKeys.shift();
|
|
34830
34851
|
};
|
|
34831
34852
|
const abortPendingSettlement = (reason, failureCategory) => {
|
|
34832
|
-
const waiting
|
|
34833
|
-
|
|
34834
|
-
|
|
34835
|
-
|
|
34836
|
-
|
|
34837
|
-
|
|
34838
|
-
|
|
34839
|
-
|
|
34840
|
-
)
|
|
34841
|
-
}
|
|
34853
|
+
for (const [key, waiting] of shared.pendingSettlements) {
|
|
34854
|
+
if (waiting.hasResult?.()) continue;
|
|
34855
|
+
shared.pendingSettlements.delete(key);
|
|
34856
|
+
waiting.settle({
|
|
34857
|
+
error: withFailureCategory(
|
|
34858
|
+
new AcpExecutorRequestError("session/prompt", reason),
|
|
34859
|
+
failureCategory
|
|
34860
|
+
)
|
|
34861
|
+
});
|
|
34862
|
+
}
|
|
34842
34863
|
};
|
|
34843
34864
|
const settleFromNotification = (method, params) => {
|
|
34844
34865
|
const hook = hooks.promptSettlement;
|
|
34845
|
-
if (hook === void 0 || shared.
|
|
34866
|
+
if (hook === void 0 || shared.pendingSettlements.size === 0) return false;
|
|
34846
34867
|
const signal = hook.fromNotification(method, params);
|
|
34847
34868
|
if (signal === void 0) return false;
|
|
34848
|
-
const waiting = shared.
|
|
34849
|
-
|
|
34850
|
-
|
|
34851
|
-
|
|
34869
|
+
const waiting = signal.promptKey === void 0 ? [...shared.pendingSettlements.values()].find(
|
|
34870
|
+
(candidate) => candidate.sessionId === signal.sessionId
|
|
34871
|
+
) : shared.pendingSettlements.get(signal.promptKey);
|
|
34872
|
+
if (waiting === void 0 || waiting.sessionId !== signal.sessionId) {
|
|
34873
|
+
return signal.promptKey !== void 0 && settledPromptKeys.includes(signal.promptKey);
|
|
34852
34874
|
}
|
|
34853
|
-
shared.
|
|
34875
|
+
shared.pendingSettlements.delete(waiting.promptKey);
|
|
34854
34876
|
rememberSettledPromptKey(waiting.promptKey);
|
|
34855
34877
|
if (signal.outcome === "error") {
|
|
34856
34878
|
waiting.onError?.();
|
|
@@ -35444,7 +35466,7 @@ function createAcpExecutor(options) {
|
|
|
35444
35466
|
startInFlight: void 0,
|
|
35445
35467
|
activeTurnId: void 0,
|
|
35446
35468
|
promptsInFlight: 0,
|
|
35447
|
-
|
|
35469
|
+
pendingSettlements: /* @__PURE__ */ new Map(),
|
|
35448
35470
|
manualCompaction: void 0,
|
|
35449
35471
|
assistantSegment: { nextSegmentIndex: 0 },
|
|
35450
35472
|
modeState: void 0,
|
|
@@ -35816,13 +35838,13 @@ function createRetryableClose(run) {
|
|
|
35816
35838
|
|
|
35817
35839
|
// ../../packages/ycodium-acp-executor/src/prompt-dispatch.ts
|
|
35818
35840
|
var dispatchAcpPrompt = (executor, input2) => {
|
|
35819
|
-
const { promise: dispatched, resolve:
|
|
35841
|
+
const { promise: dispatched, resolve: resolve4 } = Promise.withResolvers();
|
|
35820
35842
|
let written = false;
|
|
35821
35843
|
const finished = executor.prompt({
|
|
35822
35844
|
...input2,
|
|
35823
35845
|
onDispatched: (turnId) => {
|
|
35824
35846
|
written = true;
|
|
35825
|
-
|
|
35847
|
+
resolve4(turnId);
|
|
35826
35848
|
}
|
|
35827
35849
|
});
|
|
35828
35850
|
return Promise.race([
|
|
@@ -35877,7 +35899,7 @@ function toAcpMcpServers(entries) {
|
|
|
35877
35899
|
// ../../packages/ycodium-acp-executor/src/probe.ts
|
|
35878
35900
|
function withProbeTimeout(promise2, timeoutMs, what, signal) {
|
|
35879
35901
|
signal?.throwIfAborted();
|
|
35880
|
-
return new Promise((
|
|
35902
|
+
return new Promise((resolve4, reject) => {
|
|
35881
35903
|
const onAbort = () => {
|
|
35882
35904
|
clearTimeout(timer);
|
|
35883
35905
|
reject(signal?.reason ?? new Error("aborted"));
|
|
@@ -35892,7 +35914,7 @@ function withProbeTimeout(promise2, timeoutMs, what, signal) {
|
|
|
35892
35914
|
(value) => {
|
|
35893
35915
|
clearTimeout(timer);
|
|
35894
35916
|
signal?.removeEventListener("abort", onAbort);
|
|
35895
|
-
|
|
35917
|
+
resolve4(value);
|
|
35896
35918
|
},
|
|
35897
35919
|
(error62) => {
|
|
35898
35920
|
clearTimeout(timer);
|
|
@@ -36804,8 +36826,8 @@ var dshToolSubagents = {
|
|
|
36804
36826
|
|
|
36805
36827
|
// src/dshInstance.ts
|
|
36806
36828
|
var RESUME_SCHEMA_VERSION = 1;
|
|
36807
|
-
var yieldTick = () => new Promise((
|
|
36808
|
-
setImmediate(
|
|
36829
|
+
var yieldTick = () => new Promise((resolve4) => {
|
|
36830
|
+
setImmediate(resolve4);
|
|
36809
36831
|
});
|
|
36810
36832
|
var EventBus = class {
|
|
36811
36833
|
#queued = [];
|
|
@@ -36832,8 +36854,8 @@ var EventBus = class {
|
|
|
36832
36854
|
const queued = this.#queued.shift();
|
|
36833
36855
|
if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
|
|
36834
36856
|
if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
|
|
36835
|
-
return new Promise((
|
|
36836
|
-
this.#waiters.push(
|
|
36857
|
+
return new Promise((resolve4) => {
|
|
36858
|
+
this.#waiters.push(resolve4);
|
|
36837
36859
|
});
|
|
36838
36860
|
}
|
|
36839
36861
|
};
|
|
@@ -37135,6 +37157,7 @@ var createDshInstance = (config2, host) => {
|
|
|
37135
37157
|
var executors = [
|
|
37136
37158
|
{
|
|
37137
37159
|
card: DSH_CARD,
|
|
37160
|
+
lifecycle: [{ kind: "detect", reversible: true }],
|
|
37138
37161
|
createInstance: async (config2, host) => {
|
|
37139
37162
|
host.log.info("createInstance");
|
|
37140
37163
|
return createDshInstance(config2, host);
|
|
@@ -37143,9 +37166,26 @@ var executors = [
|
|
|
37143
37166
|
];
|
|
37144
37167
|
var index_default = definePlugin({
|
|
37145
37168
|
id: "agent-dsh",
|
|
37146
|
-
apiVersion:
|
|
37169
|
+
apiVersion: 60,
|
|
37147
37170
|
executors,
|
|
37148
37171
|
activate(ctx) {
|
|
37172
|
+
ctx.command({
|
|
37173
|
+
name: "effectiveConfig",
|
|
37174
|
+
description: "Settings form: the account directory an empty path resolves to on this machine.",
|
|
37175
|
+
scope: "read",
|
|
37176
|
+
payloadSchema: EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
|
|
37177
|
+
handle: async (payload) => {
|
|
37178
|
+
const request = readExecutorEffectiveRequest(payload);
|
|
37179
|
+
return {
|
|
37180
|
+
homePath: executorHomeEffectiveValue(
|
|
37181
|
+
"DSH_HOME",
|
|
37182
|
+
request,
|
|
37183
|
+
process.env,
|
|
37184
|
+
(value) => value === void 0 ? NodePath7.join(NodeOS6.homedir(), ".dsh") : NodePath7.resolve(expandHomePath(value))
|
|
37185
|
+
)
|
|
37186
|
+
};
|
|
37187
|
+
}
|
|
37188
|
+
});
|
|
37149
37189
|
ctx.log.info("dsh executor ready");
|
|
37150
37190
|
}
|
|
37151
37191
|
});
|
package/locales/en.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
{
|
|
2
|
+
"presentation": {
|
|
3
|
+
"name": "DeepSeek Harness",
|
|
4
|
+
"description": "Run DeepSeek Harness with the dsh CLI."
|
|
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 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 (~/.dsh).",
|
|
11
15
|
"placeholder": "e.g. ~/.dsh-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": "DeepSeek Harness",
|
|
4
|
+
"description": "用 dsh CLI 跑 DeepSeek Harness。"
|
|
5
|
+
},
|
|
2
6
|
"form": {
|
|
3
7
|
"binaryPath": {
|
|
4
8
|
"title": "程序路径",
|
|
@@ -9,6 +13,11 @@
|
|
|
9
13
|
"title": "账号目录",
|
|
10
14
|
"description": "会话保存在这里,因此共用同一目录的 provider 可以接手彼此的会话,目录不同的则不能。留空则使用该命令行工具的默认目录(~/.dsh)。",
|
|
11
15
|
"placeholder": "例如 ~/.dsh-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-dsh",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3799",
|
|
4
4
|
"description": "DeepSeek Harness executor: dsh CLI over Agent Client Protocol stdio.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ycodium",
|
|
@@ -22,14 +22,16 @@
|
|
|
22
22
|
"esbuild": "0.28.1",
|
|
23
23
|
"vite-plus": "0.2.2",
|
|
24
24
|
"yaml": "^2.9.0",
|
|
25
|
-
"@ycodium-ai/plugin-api": "0.2.
|
|
26
|
-
"ycodium-
|
|
27
|
-
"ycodium-executor
|
|
25
|
+
"@ycodium-ai/plugin-api": "0.2.3799",
|
|
26
|
+
"ycodium-executor-testing": "0.0.0",
|
|
27
|
+
"ycodium-acp-executor": "0.2.3799"
|
|
28
28
|
},
|
|
29
29
|
"ycodium": {
|
|
30
30
|
"plugin": "./dist/index.js",
|
|
31
31
|
"displayName": "DeepSeek Harness",
|
|
32
|
-
"
|
|
32
|
+
"displayNameKey": "presentation.name",
|
|
33
|
+
"description": "Run DeepSeek Harness with the dsh CLI.",
|
|
34
|
+
"descriptionKey": "presentation.description",
|
|
33
35
|
"icon": "./assets/icon.svg",
|
|
34
36
|
"permissions": [
|
|
35
37
|
{
|