dsh-oh-my-claude 1.4.1 → 1.4.2

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/CHANGELOG.md CHANGED
@@ -6,6 +6,16 @@ Versions from 1.0.0 up are on npm. Everything below 1.0.0 was released from the
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.4.2] - 2026-10-19
10
+
11
+ dsh: runs on 0.1.5-rc.1 through 0.1.7-rc.2; built and tested on 0.1.7-rc.2.
12
+
13
+ A fix for the dsh 0.1.x line only. Newer dsh gets the same fix from the 1.5 line.
14
+
15
+ ### Fixed
16
+
17
+ - When dsh cannot reach anyone to approve a tool, or the request is cancelled, Claude is told that nobody refused it and not to retry in a loop, instead of the bare words `approval unavailable`. One reported session retried for half an hour. Thanks to @echobeijingecho for the report and the patch it grew from (#170).
18
+
9
19
  ## [1.4.1] - 2026-09-27
10
20
 
11
21
  dsh: runs on 0.1.5-rc.1 through 0.1.7-rc.2; built and tested on 0.1.7-rc.2.
package/README.md CHANGED
@@ -96,7 +96,8 @@ dsh ships prereleases only and moves client APIs between them, so every release
96
96
 
97
97
  | Plugin | Runs on dsh | Tested on dsh | npm tag |
98
98
  | --- | --- | --- | --- |
99
- | 1.4.1 | 0.1.5-rc.1 through 0.1.7-rc.2 | 0.1.7-rc.2 | `latest`, `dsh-0.1.7` |
99
+ | 1.4.2 | 0.1.5-rc.1 through 0.1.7-rc.2 | 0.1.7-rc.2 | `dsh-0.1.7` |
100
+ | 1.4.1 | 0.1.5-rc.1 through 0.1.7-rc.2 | 0.1.7-rc.2 | none, superseded by 1.4.2 |
100
101
  | 1.4.0 | 0.1.5-rc.1 through 0.1.7-rc.2 | 0.1.7-rc.2 | none, superseded by 1.4.1 |
101
102
  | 1.3.1 | 0.1.5-rc.1 through 0.1.6-alpha.2 | 0.1.6-alpha.2 | `dsh-0.1.6` |
102
103
  | 1.2.1 | 0.1.5-rc.1 through 0.1.6-alpha.2 | 0.1.6-alpha.2 | `dsh-0.1.5` |
package/README.zh.md CHANGED
@@ -96,7 +96,8 @@ dsh 只发布预发行版,客户端 API 也会在版本之间变动,所以
96
96
 
97
97
  | 插件 | 可运行于 dsh | 测试于 dsh | npm 标签 |
98
98
  | --- | --- | --- | --- |
99
- | 1.4.1 | 0.1.5-rc.1 至 0.1.7-rc.2 | 0.1.7-rc.2 | `latest`、`dsh-0.1.7` |
99
+ | 1.4.2 | 0.1.5-rc.1 至 0.1.7-rc.2 | 0.1.7-rc.2 | `dsh-0.1.7` |
100
+ | 1.4.1 | 0.1.5-rc.1 至 0.1.7-rc.2 | 0.1.7-rc.2 | 无,已由 1.4.2 取代 |
100
101
  | 1.4.0 | 0.1.5-rc.1 至 0.1.7-rc.2 | 0.1.7-rc.2 | 无,已由 1.4.1 取代 |
101
102
  | 1.3.1 | 0.1.5-rc.1 至 0.1.6-alpha.2 | 0.1.6-alpha.2 | `dsh-0.1.6` |
102
103
  | 1.2.1 | 0.1.5-rc.1 至 0.1.6-alpha.2 | 0.1.6-alpha.2 | `dsh-0.1.5` |
@@ -916,6 +916,18 @@ export interface LiveTurn {
916
916
  * only, in the CLI's own order, up to the cap; the first file always goes even if it alone is over,
917
917
  * because a context with no diff in it is worse than a long one. */
918
918
  export declare const diffContext: (diff: WorkspaceDiff, path: string) => string;
919
+ /**
920
+ * What Claude reads when dsh answers an approval without allowing it. "unavailable" and
921
+ * "cancelled" used to reach it as the bare words `approval unavailable`, which say nothing: in one
922
+ * reported session Claude retried seven times over half an hour, then told the user to reopen the
923
+ * session elsewhere (#170). dsh answers "unavailable" when no approver is reachable or the one it
924
+ * has failed, so nobody was asked; a retry loop cannot fix that, and the person can.
925
+ */
926
+ export declare const OUTCOME_MESSAGE: {
927
+ rejected: string;
928
+ unavailable: string;
929
+ cancelled: string;
930
+ };
919
931
  /** The LlmAdapter that drives the logged-in Claude Code CLI: it owns the live `claude` processes, bridges dsh's commands and routes into them, and mirrors their transcript back into dsh. */
920
932
  export declare class ClaudeCodeAdapter extends LlmAdapter {
921
933
  ctx: PluginContext;
@@ -1679,6 +1679,18 @@ export const diffContext = (diff, path) => {
1679
1679
  parts.push(`… diff truncated (${parts.length} of ${files.length} files)`);
1680
1680
  return parts.join("\n\n");
1681
1681
  };
1682
+ /**
1683
+ * What Claude reads when dsh answers an approval without allowing it. "unavailable" and
1684
+ * "cancelled" used to reach it as the bare words `approval unavailable`, which say nothing: in one
1685
+ * reported session Claude retried seven times over half an hour, then told the user to reopen the
1686
+ * session elsewhere (#170). dsh answers "unavailable" when no approver is reachable or the one it
1687
+ * has failed, so nobody was asked; a retry loop cannot fix that, and the person can.
1688
+ */
1689
+ export const OUTCOME_MESSAGE = {
1690
+ rejected: "The user denied this action in dsh.",
1691
+ unavailable: "dsh could not ask anyone to approve this action: no approver is reachable for this session, so nobody was asked and this is not a refusal. Do not retry it in a loop. Tell the user approvals are not reaching anyone; they can answer from the dsh web UI, fix the approver, or pick a permission mode that does not ask.",
1692
+ cancelled: "The approval request was cancelled before anyone answered (the turn was stopped or the request withdrawn). Nobody refused it.",
1693
+ };
1682
1694
  /** The LlmAdapter that drives the logged-in Claude Code CLI: it owns the live `claude` processes, bridges dsh's commands and routes into them, and mirrors their transcript back into dsh. */
1683
1695
  export class ClaudeCodeAdapter extends LlmAdapter {
1684
1696
  ctx;
@@ -6156,7 +6168,7 @@ export class ClaudeCodeAdapter extends LlmAdapter {
6156
6168
  // user denied" would send Claude arguing with a person who was never asked.
6157
6169
  if (outcome === "rejected" && sessionId !== undefined && this.approvalsOff.has(sessionId))
6158
6170
  return denyResult(toolUseId, "dsh auto-denied this action: approval prompts are disabled in this session, so nobody was asked. The user can re-enable approvals in dsh or pick the Bypass permission mode.");
6159
- return denyResult(toolUseId, outcome === "rejected" ? "The user denied this action in dsh." : `approval ${outcome}`);
6171
+ return denyResult(toolUseId, OUTCOME_MESSAGE[outcome]);
6160
6172
  }
6161
6173
  // ── one-shot path (aux calls, text-mode CLI, no session id) ──────────────
6162
6174
  /** Run one request on a fresh CLI process that exits after its answer, for side calls such as a