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 +9 -6
- package/README.zh.md +3 -0
- package/docs/01-panel-cn.png +0 -0
- package/docs/01-panel-en.png +0 -0
- package/docs/02-fields-cn.png +0 -0
- package/docs/02-fields-en.png +0 -0
- package/docs/03-subagent-cn.png +0 -0
- package/docs/03-subagent-en.png +0 -0
- package/docs/04-overlay-cn.png +0 -0
- package/docs/04-overlay-en.png +0 -0
- package/package.json +1 -1
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:
|
|
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: '
|
|
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: ['
|
|
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
package/docs/01-panel-cn.png
CHANGED
|
Binary file
|
package/docs/01-panel-en.png
CHANGED
|
Binary file
|
package/docs/02-fields-cn.png
CHANGED
|
Binary file
|
package/docs/02-fields-en.png
CHANGED
|
Binary file
|
package/docs/03-subagent-cn.png
CHANGED
|
Binary file
|
package/docs/03-subagent-en.png
CHANGED
|
Binary file
|
package/docs/04-overlay-cn.png
CHANGED
|
Binary file
|
package/docs/04-overlay-en.png
CHANGED
|
Binary file
|
package/package.json
CHANGED