@ycodium-ai/agent-dsh 0.2.5253 → 0.2.5271

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.
Files changed (2) hide show
  1. package/dist/index.js +153 -153
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -7371,7 +7371,7 @@ var require_dist = __commonJS({
7371
7371
  import { definePlugin } from "@ycodium-ai/plugin-api";
7372
7372
 
7373
7373
  // ../../packages/plugin-api/src/version.ts
7374
- var PLUGIN_API_VERSION = 156;
7374
+ var PLUGIN_API_VERSION = 157;
7375
7375
 
7376
7376
  // src/index.ts
7377
7377
  import * as NodeOS8 from "node:os";
@@ -7577,158 +7577,6 @@ function approvalOutcomeForDecision(decision, optionId) {
7577
7577
  return decision !== "cancel" && optionId !== void 0 ? { outcome: "selected", optionId } : { outcome: "cancelled" };
7578
7578
  }
7579
7579
 
7580
- // ../../packages/ycodium-executor-common/src/stderrTail.ts
7581
- var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
7582
- function lastStderrTail(text, maxChars) {
7583
- if (text.length <= maxChars) return text;
7584
- let start = text.length - maxChars;
7585
- if (text[start - 1] !== "\n") {
7586
- const lineEnd = text.indexOf("\n", start);
7587
- if (lineEnd !== -1 && lineEnd < text.length - 1) return text.slice(lineEnd + 1);
7588
- const code = text.charCodeAt(start);
7589
- if (code >= 56320 && code <= 57343) start += 1;
7590
- for (const marker of REDACTION_MARKERS) {
7591
- const at = text.lastIndexOf(marker, start);
7592
- if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
7593
- }
7594
- }
7595
- return text.slice(start);
7596
- }
7597
-
7598
- // ../../packages/ycodium-acp-executor/src/errors.ts
7599
- var AcpExecutorError = class extends Error {
7600
- code;
7601
- constructor(code, message) {
7602
- super(message);
7603
- this.name = "AcpExecutorError";
7604
- this.code = code;
7605
- }
7606
- };
7607
- var AcpExecutorDisposedError = class extends AcpExecutorError {
7608
- constructor(message = "ACP executor has been disposed") {
7609
- super("disposed", message);
7610
- this.name = "AcpExecutorDisposedError";
7611
- }
7612
- };
7613
- var AcpExecutorTurnEndedError = class extends AcpExecutorError {
7614
- constructor(message = "The target turn has ended. The message was not sent.") {
7615
- super("provider-rejected", message);
7616
- this.name = "AcpExecutorTurnEndedError";
7617
- }
7618
- };
7619
- var AcpExecutorOptionRejectedError = class extends AcpExecutorError {
7620
- constructor(option, value, cause) {
7621
- const detail = acpErrorDetail(cause);
7622
- super(
7623
- "provider-rejected",
7624
- `The agent rejected the ${option}${value === void 0 ? "" : ` "${value}"`}${detail === void 0 ? "" : ` (${detail})`}. This turn was not sent.`
7625
- );
7626
- this.name = "AcpExecutorOptionRejectedError";
7627
- }
7628
- };
7629
- var AcpExecutorOptionTimeoutError = class extends AcpExecutorError {
7630
- constructor(option, value) {
7631
- super(
7632
- "provider-rejected",
7633
- `The agent did not answer the ${option} "${value}" change in time. This turn was not sent.`
7634
- );
7635
- this.name = "AcpExecutorOptionTimeoutError";
7636
- }
7637
- };
7638
- var AcpOptionWriteStoppedError = class extends Error {
7639
- constructor() {
7640
- super("option write stopped");
7641
- this.name = "AcpOptionWriteStoppedError";
7642
- }
7643
- };
7644
- function acpErrorDetail(cause) {
7645
- if (typeof cause !== "object" || cause === null) return void 0;
7646
- const message = cause.message;
7647
- const data = cause.data;
7648
- const parts = [message, data].filter(
7649
- (part) => typeof part === "string" && part.trim().length > 0
7650
- );
7651
- return parts.length === 0 ? void 0 : parts.join(": ");
7652
- }
7653
- var AcpExecutorNotStartedError = class extends AcpExecutorError {
7654
- constructor(message = "ACP session has not been started") {
7655
- super("not-started", message);
7656
- this.name = "AcpExecutorNotStartedError";
7657
- }
7658
- };
7659
- var AcpExecutorCancelTimeoutError = class extends AcpExecutorError {
7660
- constructor(message = "Timed out waiting for session/prompt to finish after cancellation") {
7661
- super("cancel-timeout", message);
7662
- this.name = "AcpExecutorCancelTimeoutError";
7663
- }
7664
- };
7665
- var AcpExecutorRequestError = class extends AcpExecutorError {
7666
- method;
7667
- constructor(method, message) {
7668
- super("request-failed", message);
7669
- this.name = "AcpExecutorRequestError";
7670
- this.method = method;
7671
- }
7672
- };
7673
- var AcpConnectionClosedError = class extends Error {
7674
- reason;
7675
- constructor(message = "ACP connection closed", options) {
7676
- super(message, options?.cause === void 0 ? void 0 : { cause: options.cause });
7677
- this.name = "AcpConnectionClosedError";
7678
- this.reason = options?.reason ?? "closed";
7679
- }
7680
- };
7681
- async function withStartupStderr(error62, stderrTail) {
7682
- if (!(error62 instanceof AcpConnectionClosedError) || stderrTail === void 0) return error62;
7683
- const tail = await stderrTail();
7684
- if (tail.length === 0) return error62;
7685
- return new AcpConnectionClosedError(`${error62.message}
7686
- Agent stderr (last lines):
7687
- ${tail}`, {
7688
- cause: error62,
7689
- reason: error62.reason
7690
- });
7691
- }
7692
- var AGENT_EXIT_STDERR_MAX_CHARS = 800;
7693
- var AGENT_EXIT_SETTLE_MS = 500;
7694
- var AcpAgentExitedError = class extends AcpConnectionClosedError {
7695
- exitCode;
7696
- constructor(message, exitCode, cause) {
7697
- super(message, { cause, reason: "input-ended" });
7698
- this.name = "AcpAgentExitedError";
7699
- this.exitCode = exitCode;
7700
- }
7701
- };
7702
- var settledExitCode = async (exited) => {
7703
- if (exited === void 0) return void 0;
7704
- let timer;
7705
- try {
7706
- return await Promise.race([
7707
- exited.catch(() => void 0),
7708
- new Promise((resolve5) => {
7709
- timer = setTimeout(() => resolve5(void 0), AGENT_EXIT_SETTLE_MS);
7710
- })
7711
- ]);
7712
- } finally {
7713
- clearTimeout(timer);
7714
- }
7715
- };
7716
- async function describeAgentExit(input2) {
7717
- const [exitCode, tail] = await Promise.all([
7718
- settledExitCode(input2.exited),
7719
- input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
7720
- ]);
7721
- const head = exitCode === void 0 ? "The agent closed its connection." : exitCode === null ? "The agent process exited without an exit code." : `The agent process exited with code ${exitCode}.`;
7722
- const excerpt = lastStderrTail(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
7723
- return new AcpAgentExitedError(
7724
- excerpt.length === 0 ? head : `${head}
7725
- Agent stderr (last lines):
7726
- ${excerpt}`,
7727
- exitCode,
7728
- input2.cause
7729
- );
7730
- }
7731
-
7732
7580
  // ../../packages/ycodium-acp-executor/src/event-stream.ts
7733
7581
  var UnboundedEventStream = class {
7734
7582
  subscribers = /* @__PURE__ */ new Set();
@@ -7907,6 +7755,158 @@ function acpModelChoicesFromConfigOptions(configOptions) {
7907
7755
  return flattenChoices(modelOption["options"], asString(modelOption["currentValue"])?.trim());
7908
7756
  }
7909
7757
 
7758
+ // ../../packages/ycodium-executor-common/src/stderrTail.ts
7759
+ var REDACTION_MARKERS = ["[redacted]", "[pairing-url]"];
7760
+ function lastStderrTail(text, maxChars) {
7761
+ if (text.length <= maxChars) return text;
7762
+ let start = text.length - maxChars;
7763
+ if (text[start - 1] !== "\n") {
7764
+ const lineEnd = text.indexOf("\n", start);
7765
+ if (lineEnd !== -1 && lineEnd < text.length - 1) return text.slice(lineEnd + 1);
7766
+ const code = text.charCodeAt(start);
7767
+ if (code >= 56320 && code <= 57343) start += 1;
7768
+ for (const marker of REDACTION_MARKERS) {
7769
+ const at = text.lastIndexOf(marker, start);
7770
+ if (at !== -1 && at < start && start < at + marker.length) start = at + marker.length;
7771
+ }
7772
+ }
7773
+ return text.slice(start);
7774
+ }
7775
+
7776
+ // ../../packages/ycodium-acp-executor/src/errors.ts
7777
+ var AcpExecutorError = class extends Error {
7778
+ code;
7779
+ constructor(code, message) {
7780
+ super(message);
7781
+ this.name = "AcpExecutorError";
7782
+ this.code = code;
7783
+ }
7784
+ };
7785
+ var AcpExecutorDisposedError = class extends AcpExecutorError {
7786
+ constructor(message = "ACP executor has been disposed") {
7787
+ super("disposed", message);
7788
+ this.name = "AcpExecutorDisposedError";
7789
+ }
7790
+ };
7791
+ var AcpExecutorTurnEndedError = class extends AcpExecutorError {
7792
+ constructor(message = "The target turn has ended. The message was not sent.") {
7793
+ super("provider-rejected", message);
7794
+ this.name = "AcpExecutorTurnEndedError";
7795
+ }
7796
+ };
7797
+ var AcpExecutorOptionRejectedError = class extends AcpExecutorError {
7798
+ constructor(option, value, cause) {
7799
+ const detail = acpErrorDetail(cause);
7800
+ super(
7801
+ "provider-rejected",
7802
+ `The agent rejected the ${option}${value === void 0 ? "" : ` "${value}"`}${detail === void 0 ? "" : ` (${detail})`}. This turn was not sent.`
7803
+ );
7804
+ this.name = "AcpExecutorOptionRejectedError";
7805
+ }
7806
+ };
7807
+ var AcpExecutorOptionTimeoutError = class extends AcpExecutorError {
7808
+ constructor(option, value) {
7809
+ super(
7810
+ "provider-rejected",
7811
+ `The agent did not answer the ${option} "${value}" change in time. This turn was not sent.`
7812
+ );
7813
+ this.name = "AcpExecutorOptionTimeoutError";
7814
+ }
7815
+ };
7816
+ var AcpOptionWriteStoppedError = class extends Error {
7817
+ constructor() {
7818
+ super("option write stopped");
7819
+ this.name = "AcpOptionWriteStoppedError";
7820
+ }
7821
+ };
7822
+ function acpErrorDetail(cause) {
7823
+ if (typeof cause !== "object" || cause === null) return void 0;
7824
+ const message = cause.message;
7825
+ const data = cause.data;
7826
+ const parts = [message, data].filter(
7827
+ (part) => typeof part === "string" && part.trim().length > 0
7828
+ );
7829
+ return parts.length === 0 ? void 0 : parts.join(": ");
7830
+ }
7831
+ var AcpExecutorNotStartedError = class extends AcpExecutorError {
7832
+ constructor(message = "ACP session has not been started") {
7833
+ super("not-started", message);
7834
+ this.name = "AcpExecutorNotStartedError";
7835
+ }
7836
+ };
7837
+ var AcpExecutorCancelTimeoutError = class extends AcpExecutorError {
7838
+ constructor(message = "Timed out waiting for session/prompt to finish after cancellation") {
7839
+ super("cancel-timeout", message);
7840
+ this.name = "AcpExecutorCancelTimeoutError";
7841
+ }
7842
+ };
7843
+ var AcpExecutorRequestError = class extends AcpExecutorError {
7844
+ method;
7845
+ constructor(method, message) {
7846
+ super("request-failed", message);
7847
+ this.name = "AcpExecutorRequestError";
7848
+ this.method = method;
7849
+ }
7850
+ };
7851
+ var AcpConnectionClosedError = class extends Error {
7852
+ reason;
7853
+ constructor(message = "ACP connection closed", options) {
7854
+ super(message, options?.cause === void 0 ? void 0 : { cause: options.cause });
7855
+ this.name = "AcpConnectionClosedError";
7856
+ this.reason = options?.reason ?? "closed";
7857
+ }
7858
+ };
7859
+ async function withStartupStderr(error62, stderrTail) {
7860
+ if (!(error62 instanceof AcpConnectionClosedError) || stderrTail === void 0) return error62;
7861
+ const tail = await stderrTail();
7862
+ if (tail.length === 0) return error62;
7863
+ return new AcpConnectionClosedError(`${error62.message}
7864
+ Agent stderr (last lines):
7865
+ ${tail}`, {
7866
+ cause: error62,
7867
+ reason: error62.reason
7868
+ });
7869
+ }
7870
+ var AGENT_EXIT_STDERR_MAX_CHARS = 800;
7871
+ var AGENT_EXIT_SETTLE_MS = 500;
7872
+ var AcpAgentExitedError = class extends AcpConnectionClosedError {
7873
+ exitCode;
7874
+ constructor(message, exitCode, cause) {
7875
+ super(message, { cause, reason: "input-ended" });
7876
+ this.name = "AcpAgentExitedError";
7877
+ this.exitCode = exitCode;
7878
+ }
7879
+ };
7880
+ var settledExitCode = async (exited) => {
7881
+ if (exited === void 0) return void 0;
7882
+ let timer;
7883
+ try {
7884
+ return await Promise.race([
7885
+ exited.catch(() => void 0),
7886
+ new Promise((resolve5) => {
7887
+ timer = setTimeout(() => resolve5(void 0), AGENT_EXIT_SETTLE_MS);
7888
+ })
7889
+ ]);
7890
+ } finally {
7891
+ clearTimeout(timer);
7892
+ }
7893
+ };
7894
+ async function describeAgentExit(input2) {
7895
+ const [exitCode, tail] = await Promise.all([
7896
+ settledExitCode(input2.exited),
7897
+ input2.stderrTail === void 0 ? "" : Promise.resolve().then(input2.stderrTail).catch(() => "")
7898
+ ]);
7899
+ const head = exitCode === void 0 ? "The agent closed its connection." : exitCode === null ? "The agent process exited without an exit code." : `The agent process exited with code ${exitCode}.`;
7900
+ const excerpt = lastStderrTail(tail.trim(), AGENT_EXIT_STDERR_MAX_CHARS);
7901
+ return new AcpAgentExitedError(
7902
+ excerpt.length === 0 ? head : `${head}
7903
+ Agent stderr (last lines):
7904
+ ${excerpt}`,
7905
+ exitCode,
7906
+ input2.cause
7907
+ );
7908
+ }
7909
+
7910
7910
  // ../../packages/ycodium-acp-executor/src/util.ts
7911
7911
  function isRecord2(value) {
7912
7912
  return typeof value === "object" && value !== null && !Array.isArray(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ycodium-ai/agent-dsh",
3
- "version": "0.2.5253",
3
+ "version": "0.2.5271",
4
4
  "description": "DeepSeek Harness executor: dsh CLI over Agent Client Protocol stdio.",
5
5
  "keywords": [
6
6
  "ycodium",
@@ -22,9 +22,9 @@
22
22
  "esbuild": "0.28.1",
23
23
  "vite-plus": "0.2.2",
24
24
  "yaml": "^2.9.0",
25
+ "ycodium-acp-executor": "0.2.5271",
26
+ "@ycodium-ai/plugin-api": "0.2.0",
25
27
  "ycodium-credential-account": "0.0.0",
26
- "ycodium-acp-executor": "0.2.5253",
27
- "@ycodium-ai/plugin-api": "0.2.5253",
28
28
  "ycodium-executor-testing": "0.0.0",
29
29
  "ycodium-instance-config": "0.0.0"
30
30
  },