dsh-hitl 0.1.0 → 0.1.1

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/README.md CHANGED
@@ -36,6 +36,9 @@ English | [中文](README.zh.md)
36
36
  ## 1. Install
37
37
 
38
38
  ```sh
39
+ # From npm (the canonical install)
40
+ dsh plugin --profile <your profile> add dsh-hitl
41
+
39
42
  # Straight from GitHub (nothing to build)
40
43
  dsh plugin --profile <your profile> add github:YunpengDon/dsh-hitl
41
44
 
@@ -66,7 +69,7 @@ Once installed:
66
69
  config:
67
70
  protect:
68
71
  - tool: bash # tool name; patterns like 'mcp__*' work too
69
- title: 执行命令前确认 # panel title (bold, wraps)
72
+ title: Confirm before running # panel title (bold, wraps)
70
73
  countdown: { seconds: 30, action: reject }
71
74
  reject: { feedback: true } # show the feedback box on reject
72
75
  ```
@@ -82,13 +85,13 @@ export const inject = ['hitl'] // wait for the hitl service before ap
82
85
  export function apply(ctx) {
83
86
  // Passing your own ctx as the third argument binds the mount to this plugin's lifetime
84
87
  ctx.hitl.protect('bash', {
85
- title: '这条命令要执行吗?',
88
+ title: 'Run this command?',
86
89
  countdown: { seconds: 30, action: 'reject' },
87
90
  reject: { feedback: true },
88
91
  }, ctx)
89
92
 
90
93
  ctx.hitl.protect(['write', 'edit'], { // arrays, globs, RegExp, and predicates all work
91
- title: '改动前确认',
94
+ title: 'Confirm before editing',
92
95
  diff: { path: 'file_path', before: 'old_string', after: 'new_string' }, // folded into a side-by-side diff
93
96
  countdown: null, // no countdown = wait forever (still cancellable)
94
97
  }, ctx)
@@ -146,16 +149,16 @@ Without `fields`, the proposal is **every parameter of this call**:
146
149
  ### FieldSpec
147
150
 
148
151
  ```js
149
- { param: 'content', title: '新内容', description: '会写入文件的内容',
152
+ { param: 'content', title: 'New content', description: 'Text that will be written to the file',
150
153
  render: 'markdown', // markdown | text | diff | json | hidden
151
154
  editable: true, // overrides the default editability
152
- labels: ['不可撤销'], // field-level labels
155
+ labels: ['irreversible'], // field-level labels
153
156
  diff: { before: 'old_string', after: 'new_string', path: 'file_path' } } // used when render: 'diff'
154
157
  ```
155
158
 
156
159
  - With no `render`, a field renders as a diff when one can be configured, and as a markdown input otherwise.
157
160
  - When `fields` is given, **only** the listed fields are shown (parameters you leave out never reach the panel).
158
- - Config rows may shorten a spec to a bare string: `fields: ['command', { param: 'cwd', title: '工作目录' }]`.
161
+ - Config rows may shorten a spec to a bare string: `fields: ['command', { param: 'cwd', title: 'Working directory' }]`.
159
162
 
160
163
  ### The three endings of a countdown
161
164
 
package/README.zh.md CHANGED
@@ -40,6 +40,9 @@
40
40
  ## 1. 安装
41
41
 
42
42
  ```sh
43
+ # 从 npm 装(推荐方式)
44
+ dsh plugin --profile <你的 profile> add dsh-hitl
45
+
43
46
  # 直接从 GitHub 装(无需构建)
44
47
  dsh plugin --profile <你的 profile> add github:YunpengDon/dsh-hitl
45
48
 
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-hitl",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Human-in-the-loop gate for DSH tool calls: mount any tool behind an approve / modify / reject decision card in the DSH Web UI, with an optional countdown.",
5
5
  "keywords": [
6
6
  "dsh",