@ycodium-ai/agent-dsh 0.2.3710 → 0.2.3766

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 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((resolve3) => {
7696
- subscriber.wake = resolve3;
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, resolve3) {
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, resolve3);
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, resolve3) : NONE;
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 ?? (resolve3 ? inst._zod.innerType : void 0);
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((resolve3, reject) => {
30673
+ const response = new Promise((resolve4, reject) => {
30665
30674
  const pendingResponse = {
30666
30675
  resolve: (value) => {
30667
30676
  try {
30668
- resolve3(mapResponse ? mapResponse(value) : value);
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((resolve3) => {
30726
- this.abortController.signal.addEventListener("abort", () => resolve3());
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((resolve3, reject) => {
31621
- this.waiters.push({ resolve: resolve3, reject });
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: resolve3, reject } = Promise.withResolvers();
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: resolve3,
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((resolve3) => {
32700
- idleWaiters.push(resolve3);
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((resolve3) => {
32786
- this.waiters.push(resolve3);
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((resolve3) => {
32995
+ new Promise((resolve4) => {
32987
32996
  timer = setTimeout(
32988
- resolve3,
32997
+ resolve4,
32989
32998
  options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
32990
32999
  );
32991
33000
  })
@@ -33830,12 +33839,12 @@ function createPromptResults({
33830
33839
  }) {
33831
33840
  const prompts = /* @__PURE__ */ new Map();
33832
33841
  const add = (identity, finish) => {
33833
- const { promise: done, resolve: resolve3 } = Promise.withResolvers();
33842
+ const { promise: done, resolve: resolve4 } = Promise.withResolvers();
33834
33843
  const record2 = {
33835
33844
  ...identity,
33836
33845
  finish,
33837
33846
  done,
33838
- resolve: resolve3,
33847
+ resolve: resolve4,
33839
33848
  rejected: false,
33840
33849
  interrupted: false,
33841
33850
  finished: false
@@ -33883,9 +33892,9 @@ function createPromptResults({
33883
33892
  try {
33884
33893
  const drained = await Promise.race([
33885
33894
  Promise.all(claimed.map((record2) => record2.done)).then(() => true),
33886
- new Promise((resolve3) => {
33895
+ new Promise((resolve4) => {
33887
33896
  timer = setTimeout(
33888
- () => resolve3(false),
33897
+ () => resolve4(false),
33889
33898
  options.resultDrainTimeoutMs ?? DEFAULT_RESULT_DRAIN_TIMEOUT_MS
33890
33899
  );
33891
33900
  })
@@ -34045,14 +34054,14 @@ function createExecutorRequests({
34045
34054
  }
34046
34055
  }
34047
34056
  const requestId = randomId();
34048
- const outcome = await new Promise((resolve3) => {
34057
+ const outcome = await new Promise((resolve4) => {
34049
34058
  const pending = {
34050
34059
  requestId,
34051
34060
  request: params,
34052
34061
  permissionRequest,
34053
34062
  turnId: shared.activeTurnId,
34054
34063
  settled: false,
34055
- resolve: resolve3
34064
+ resolve: resolve4
34056
34065
  };
34057
34066
  approvals.add(pending);
34058
34067
  emit(
@@ -34270,14 +34279,14 @@ function createExecutorRuntime({
34270
34279
  if (!promptMutex.isLocked) {
34271
34280
  return true;
34272
34281
  }
34273
- return await new Promise((resolve3) => {
34282
+ return await new Promise((resolve4) => {
34274
34283
  const timer = setTimeout(() => {
34275
34284
  shared.promptWaiters = shared.promptWaiters.filter((waiter) => waiter !== onSettle);
34276
- resolve3(false);
34285
+ resolve4(false);
34277
34286
  }, timeoutMs);
34278
34287
  const onSettle = () => {
34279
34288
  clearTimeout(timer);
34280
- resolve3(true);
34289
+ resolve4(true);
34281
34290
  };
34282
34291
  shared.promptWaiters.push(onSettle);
34283
34292
  });
@@ -35816,13 +35825,13 @@ function createRetryableClose(run) {
35816
35825
 
35817
35826
  // ../../packages/ycodium-acp-executor/src/prompt-dispatch.ts
35818
35827
  var dispatchAcpPrompt = (executor, input2) => {
35819
- const { promise: dispatched, resolve: resolve3 } = Promise.withResolvers();
35828
+ const { promise: dispatched, resolve: resolve4 } = Promise.withResolvers();
35820
35829
  let written = false;
35821
35830
  const finished = executor.prompt({
35822
35831
  ...input2,
35823
35832
  onDispatched: (turnId) => {
35824
35833
  written = true;
35825
- resolve3(turnId);
35834
+ resolve4(turnId);
35826
35835
  }
35827
35836
  });
35828
35837
  return Promise.race([
@@ -35877,7 +35886,7 @@ function toAcpMcpServers(entries) {
35877
35886
  // ../../packages/ycodium-acp-executor/src/probe.ts
35878
35887
  function withProbeTimeout(promise2, timeoutMs, what, signal) {
35879
35888
  signal?.throwIfAborted();
35880
- return new Promise((resolve3, reject) => {
35889
+ return new Promise((resolve4, reject) => {
35881
35890
  const onAbort = () => {
35882
35891
  clearTimeout(timer);
35883
35892
  reject(signal?.reason ?? new Error("aborted"));
@@ -35892,7 +35901,7 @@ function withProbeTimeout(promise2, timeoutMs, what, signal) {
35892
35901
  (value) => {
35893
35902
  clearTimeout(timer);
35894
35903
  signal?.removeEventListener("abort", onAbort);
35895
- resolve3(value);
35904
+ resolve4(value);
35896
35905
  },
35897
35906
  (error62) => {
35898
35907
  clearTimeout(timer);
@@ -36804,8 +36813,8 @@ var dshToolSubagents = {
36804
36813
 
36805
36814
  // src/dshInstance.ts
36806
36815
  var RESUME_SCHEMA_VERSION = 1;
36807
- var yieldTick = () => new Promise((resolve3) => {
36808
- setImmediate(resolve3);
36816
+ var yieldTick = () => new Promise((resolve4) => {
36817
+ setImmediate(resolve4);
36809
36818
  });
36810
36819
  var EventBus = class {
36811
36820
  #queued = [];
@@ -36832,8 +36841,8 @@ var EventBus = class {
36832
36841
  const queued = this.#queued.shift();
36833
36842
  if (queued !== void 0) return Promise.resolve({ done: false, value: queued });
36834
36843
  if (this.#closed) return Promise.resolve({ done: true, value: void 0 });
36835
- return new Promise((resolve3) => {
36836
- this.#waiters.push(resolve3);
36844
+ return new Promise((resolve4) => {
36845
+ this.#waiters.push(resolve4);
36837
36846
  });
36838
36847
  }
36839
36848
  };
@@ -37135,6 +37144,7 @@ var createDshInstance = (config2, host) => {
37135
37144
  var executors = [
37136
37145
  {
37137
37146
  card: DSH_CARD,
37147
+ lifecycle: [{ kind: "detect", reversible: true }],
37138
37148
  createInstance: async (config2, host) => {
37139
37149
  host.log.info("createInstance");
37140
37150
  return createDshInstance(config2, host);
@@ -37143,9 +37153,26 @@ var executors = [
37143
37153
  ];
37144
37154
  var index_default = definePlugin({
37145
37155
  id: "agent-dsh",
37146
- apiVersion: 53,
37156
+ apiVersion: 56,
37147
37157
  executors,
37148
37158
  activate(ctx) {
37159
+ ctx.command({
37160
+ name: "effectiveConfig",
37161
+ description: "Settings form: the account directory an empty path resolves to on this machine.",
37162
+ scope: "read",
37163
+ payloadSchema: EXECUTOR_EFFECTIVE_PAYLOAD_SCHEMA,
37164
+ handle: async (payload) => {
37165
+ const request = readExecutorEffectiveRequest(payload);
37166
+ return {
37167
+ homePath: executorHomeEffectiveValue(
37168
+ "DSH_HOME",
37169
+ request,
37170
+ process.env,
37171
+ (value) => value === void 0 ? NodePath7.join(NodeOS6.homedir(), ".dsh") : NodePath7.resolve(expandHomePath(value))
37172
+ )
37173
+ };
37174
+ }
37175
+ });
37149
37176
  ctx.log.info("dsh executor ready");
37150
37177
  }
37151
37178
  });
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": {
@@ -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.3710",
3
+ "version": "0.2.3766",
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.3710",
26
- "ycodium-acp-executor": "0.2.3710",
27
- "ycodium-executor-testing": "0.0.0"
25
+ "@ycodium-ai/plugin-api": "0.2.3766",
26
+ "ycodium-executor-testing": "0.0.0",
27
+ "ycodium-acp-executor": "0.2.3766"
28
28
  },
29
29
  "ycodium": {
30
30
  "plugin": "./dist/index.js",
31
31
  "displayName": "DeepSeek Harness",
32
- "description": "Run DeepSeek Harness (dsh --profile acp) with its session/resume continuation and environment-variable credentials.",
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
  {