hermes-action-bridge 0.2.0
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 +40 -0
- package/CONTRIBUTING.md +28 -0
- package/LICENSE +21 -0
- package/README.md +323 -0
- package/dist/adapters/hermes-cli.d.ts +3 -0
- package/dist/adapters/hermes-cli.js +48 -0
- package/dist/adapters/hermes-cli.js.map +1 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +271 -0
- package/dist/cli.js.map +1 -0
- package/dist/config.d.ts +5 -0
- package/dist/config.js +172 -0
- package/dist/config.js.map +1 -0
- package/dist/context.d.ts +2 -0
- package/dist/context.js +15 -0
- package/dist/context.js.map +1 -0
- package/dist/doctor.d.ts +18 -0
- package/dist/doctor.js +77 -0
- package/dist/doctor.js.map +1 -0
- package/dist/install/file-edit.d.ts +12 -0
- package/dist/install/file-edit.js +18 -0
- package/dist/install/file-edit.js.map +1 -0
- package/dist/install/install-service.d.ts +26 -0
- package/dist/install/install-service.js +59 -0
- package/dist/install/install-service.js.map +1 -0
- package/dist/install/managed-file.d.ts +9 -0
- package/dist/install/managed-file.js +157 -0
- package/dist/install/managed-file.js.map +1 -0
- package/dist/install/marker-block.d.ts +10 -0
- package/dist/install/marker-block.js +61 -0
- package/dist/install/marker-block.js.map +1 -0
- package/dist/install/mcp-config.d.ts +15 -0
- package/dist/install/mcp-config.js +65 -0
- package/dist/install/mcp-config.js.map +1 -0
- package/dist/install/paths.d.ts +6 -0
- package/dist/install/paths.js +22 -0
- package/dist/install/paths.js.map +1 -0
- package/dist/install/templates.d.ts +16 -0
- package/dist/install/templates.js +86 -0
- package/dist/install/templates.js.map +1 -0
- package/dist/install/types.d.ts +18 -0
- package/dist/install/types.js +2 -0
- package/dist/install/types.js.map +1 -0
- package/dist/mcp-server.d.ts +1 -0
- package/dist/mcp-server.js +69 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/policy.d.ts +9 -0
- package/dist/policy.js +25 -0
- package/dist/policy.js.map +1 -0
- package/dist/prompt.d.ts +2 -0
- package/dist/prompt.js +34 -0
- package/dist/prompt.js.map +1 -0
- package/dist/run.d.ts +2 -0
- package/dist/run.js +27 -0
- package/dist/run.js.map +1 -0
- package/dist/status.d.ts +8 -0
- package/dist/status.js +10 -0
- package/dist/status.js.map +1 -0
- package/dist/types.d.ts +77 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/docs/ARCHITECTURE.md +105 -0
- package/docs/FUNCTIONAL-TESTS.md +97 -0
- package/examples/claude-code/CLAUDE.md +21 -0
- package/examples/claude-code/SKILL.md +55 -0
- package/examples/codex/AGENTS.md +21 -0
- package/examples/codex/SKILL.md +55 -0
- package/examples/configs/basic.yaml +36 -0
- package/examples/configs/strict.yaml +26 -0
- package/examples/configs/yolo.yaml +19 -0
- package/package.json +59 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented here. The format is based on
|
|
4
|
+
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
|
|
5
|
+
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
|
+
|
|
7
|
+
## [0.2.0] - 2026-06-30
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Native agent skills installer: `hermes-action install|uninstall <claude-code|codex|all|mcp>`.
|
|
12
|
+
Installs the open-standard `SKILL.md` to `~/.claude/skills` and `~/.codex/skills`.
|
|
13
|
+
- `hermes-action doctor` (`--json`, `--probe`): checks Node, configuration, Hermes availability,
|
|
14
|
+
Claude Code / Codex availability, and installed-skill state.
|
|
15
|
+
- Opt-in project hints (`--project-hint`): a marker-managed block in `CLAUDE.md` / `AGENTS.md`.
|
|
16
|
+
- Project-scoped skills (`--project`) and MCP config help: `install mcp` prints per-client snippets
|
|
17
|
+
(JSON for Claude Code / Cursor / VS Code, TOML for Codex); `install mcp --write` merges the
|
|
18
|
+
project `.mcp.json`, preserving other servers.
|
|
19
|
+
- `--dry-run` and `--print` (write nothing) and `--force` (replace a managed skill).
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- The MCP server reports failed Hermes runs as errors (`isError`) and surfaces both stdout and
|
|
24
|
+
stderr instead of hiding failure detail.
|
|
25
|
+
- The package version is sourced from `package.json` in one place; build and packaging hardened so
|
|
26
|
+
local drafts never ship in the npm tarball.
|
|
27
|
+
|
|
28
|
+
### Security
|
|
29
|
+
|
|
30
|
+
- The installer never modifies `CLAUDE.md` / `AGENTS.md` without `--project-hint`, refuses to
|
|
31
|
+
overwrite a file it did not generate, stays idempotent, and resolves paths cross-platform.
|
|
32
|
+
|
|
33
|
+
## [0.1.0]
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Initial Hermes Action Bridge: `run`, `presets`, `status`, `mcp`, and `init` commands.
|
|
38
|
+
- Configurable presets, a conservative risk policy (downgrade risky `execute` to `request-approval`),
|
|
39
|
+
an explicit `--yolo` escape hatch, context-file injection with size limits, dry-run mode, and a
|
|
40
|
+
minimal MCP server exposing `hermes_run`, `hermes_plan`, `hermes_presets`, and `hermes_status`.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution.
|
|
4
|
+
|
|
5
|
+
## Local setup
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install
|
|
9
|
+
npm run check
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
## Development rules
|
|
13
|
+
|
|
14
|
+
- Keep the bridge generic. Do not add project-specific presets to the default package.
|
|
15
|
+
- Prefer configuration over hardcoded workflows.
|
|
16
|
+
- Do not add provider or platform secrets to examples or tests.
|
|
17
|
+
- Keep the MCP surface small and stable.
|
|
18
|
+
- Add tests for any policy, config, adapter, or prompt-envelope change.
|
|
19
|
+
|
|
20
|
+
## Release checklist
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm run check
|
|
24
|
+
npm pack --dry-run
|
|
25
|
+
git diff --check
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Verify the package from the packed tarball before publishing to npm.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Cyril Guilleminot
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,323 @@
|
|
|
1
|
+
# Hermes Action Bridge
|
|
2
|
+
|
|
3
|
+
[](https://github.com/TheBlueHouse75/hermes-action-bridge/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
A configurable bridge that lets external agents delegate real-world actions to [Hermes Agent](https://hermes-agent.nousresearch.com/docs) without reimplementing Hermes skills, tools, platform integrations, browser automation, cron jobs, or messaging flows.
|
|
6
|
+
|
|
7
|
+
Use it from Claude Code, Codex, Cursor, CI jobs, shell scripts, or any MCP-capable client.
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
external agent -> hermes-action -> Hermes Agent -> skills/tools/integrations
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Why this exists
|
|
14
|
+
|
|
15
|
+
Coding agents are good at understanding a repository. They should not duplicate your automation stack.
|
|
16
|
+
|
|
17
|
+
If an agent needs to do something outside its local coding session — research, schedule a job, open a browser workflow, send a message, prepare a social post, use a Hermes skill, or coordinate with a messaging gateway — it can delegate that request to Hermes through this bridge.
|
|
18
|
+
|
|
19
|
+
## Features
|
|
20
|
+
|
|
21
|
+
- Generic `hermes-action run` command for one-shot delegation.
|
|
22
|
+
- Configurable presets for skills, toolsets, provider/model, profile, source, and max turns.
|
|
23
|
+
- Safety policy that can downgrade risky `execute` requests to `request-approval`.
|
|
24
|
+
- Explicit `--yolo` mode for users who intentionally want to bypass bridge-level policy.
|
|
25
|
+
- Context file injection with size limits.
|
|
26
|
+
- Dry-run mode for debugging the exact Hermes command and prompt.
|
|
27
|
+
- Minimal MCP server exposing delegation tools: `hermes_run`, `hermes_plan`, `hermes_presets`, and `hermes_status`.
|
|
28
|
+
- No project-specific assumptions. All behavior is configured through YAML and CLI flags.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- Node.js 20 or newer.
|
|
33
|
+
- Hermes Agent installed and available as `hermes`, or configured with a custom command path.
|
|
34
|
+
|
|
35
|
+
Check Hermes:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
hermes --version
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Installation
|
|
42
|
+
|
|
43
|
+
From a local checkout:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
npm install
|
|
47
|
+
npm run build
|
|
48
|
+
npm link
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Then:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
hermes-action --version
|
|
55
|
+
hermes-action status
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
When published to npm, installation will be:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install -g hermes-action-bridge
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick start
|
|
65
|
+
|
|
66
|
+
Create a config file in your project:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
hermes-action init
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Ask Hermes for a safe plan:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
hermes-action run --mode plan "Find the best next action from this repository context."
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
Delegate with a context file:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
hermes-action run \
|
|
82
|
+
--preset research \
|
|
83
|
+
--context ./notes.md \
|
|
84
|
+
"Analyze this and return the next concrete action."
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Run a dry-run to inspect what will be sent to Hermes:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
hermes-action run --dry-run --json "Summarize this project."
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Execution modes
|
|
94
|
+
|
|
95
|
+
- `plan`: Hermes returns a plan only. No side effects.
|
|
96
|
+
- `draft`: Hermes produces an artifact only. No external side effects.
|
|
97
|
+
- `execute`: Hermes may execute allowed actions, while still following Hermes' own safety rules.
|
|
98
|
+
- `request-approval`: Hermes prepares the action and asks the human for approval before irreversible external effects.
|
|
99
|
+
|
|
100
|
+
If the bridge detects a risky request in `execute` mode, it can automatically switch to `request-approval` unless YOLO is enabled.
|
|
101
|
+
|
|
102
|
+
Risk categories:
|
|
103
|
+
|
|
104
|
+
- `publish_external`
|
|
105
|
+
- `send_message`
|
|
106
|
+
- `send_email`
|
|
107
|
+
- `delete`
|
|
108
|
+
- `payment`
|
|
109
|
+
- `git_push`
|
|
110
|
+
- `credential_change`
|
|
111
|
+
|
|
112
|
+
## YOLO mode
|
|
113
|
+
|
|
114
|
+
YOLO mode is off by default.
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
hermes-action run --yolo --mode execute "Do the task now."
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
YOLO only bypasses the bridge policy. It does not remove Hermes Agent's own safety rules, provider/tool approval prompts, or platform constraints.
|
|
121
|
+
|
|
122
|
+
Use it only when the caller and environment are trusted.
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
|
|
126
|
+
`hermes-action` loads config in this order:
|
|
127
|
+
|
|
128
|
+
```text
|
|
129
|
+
CLI flags > project .hermes-action.yaml > user config > built-in defaults
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
User config path:
|
|
133
|
+
|
|
134
|
+
```text
|
|
135
|
+
~/.config/hermes-action/config.yaml
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
Project config path:
|
|
139
|
+
|
|
140
|
+
```text
|
|
141
|
+
.hermes-action.yaml
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
Example:
|
|
145
|
+
|
|
146
|
+
```yaml
|
|
147
|
+
runtime:
|
|
148
|
+
adapter: hermes-cli
|
|
149
|
+
command: hermes
|
|
150
|
+
|
|
151
|
+
defaults:
|
|
152
|
+
mode: plan
|
|
153
|
+
source: external-agent
|
|
154
|
+
max_turns: 30
|
|
155
|
+
preset: default
|
|
156
|
+
|
|
157
|
+
presets:
|
|
158
|
+
default:
|
|
159
|
+
description: No extra skills or toolsets. Uses the active Hermes profile.
|
|
160
|
+
skills: []
|
|
161
|
+
toolsets: []
|
|
162
|
+
|
|
163
|
+
research:
|
|
164
|
+
description: General research and synthesis.
|
|
165
|
+
skills: []
|
|
166
|
+
toolsets: [web, terminal, file]
|
|
167
|
+
|
|
168
|
+
coding:
|
|
169
|
+
description: Repository inspection and runtime validation.
|
|
170
|
+
skills: [developer-assurance-and-validation, runtime-debugging]
|
|
171
|
+
toolsets: [terminal, file]
|
|
172
|
+
|
|
173
|
+
policy:
|
|
174
|
+
yolo: false
|
|
175
|
+
require_approval_for:
|
|
176
|
+
- publish_external
|
|
177
|
+
- send_message
|
|
178
|
+
- send_email
|
|
179
|
+
- delete
|
|
180
|
+
- payment
|
|
181
|
+
- git_push
|
|
182
|
+
- credential_change
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
## CLI reference
|
|
186
|
+
|
|
187
|
+
```bash
|
|
188
|
+
hermes-action init [--file .hermes-action.yaml] [--force]
|
|
189
|
+
hermes-action run [options] "request"
|
|
190
|
+
hermes-action presets [--json]
|
|
191
|
+
hermes-action status [--json]
|
|
192
|
+
hermes-action mcp
|
|
193
|
+
hermes-action install <claude-code|codex|all|mcp> [options]
|
|
194
|
+
hermes-action uninstall <claude-code|codex|all|mcp> [options]
|
|
195
|
+
hermes-action doctor [--json] [--probe]
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
Common `run` options:
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
--mode <plan|draft|execute|request-approval>
|
|
202
|
+
--preset <name>
|
|
203
|
+
--context <path...>
|
|
204
|
+
--config <path>
|
|
205
|
+
--profile <name>
|
|
206
|
+
--provider <name>
|
|
207
|
+
--model <name>
|
|
208
|
+
--max-turns <number>
|
|
209
|
+
--source <name>
|
|
210
|
+
--yolo
|
|
211
|
+
--dry-run
|
|
212
|
+
--json
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
## Native agent skills
|
|
216
|
+
|
|
217
|
+
Instead of pasting instructions by hand, install a native skill so Claude Code and Codex know when to delegate to Hermes. The skill is the same open-standard `SKILL.md` for both agents; the CLI stays the deterministic execution layer.
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
hermes-action doctor # check Node, Hermes, agents, and installed skills
|
|
221
|
+
hermes-action install all # ~/.claude/skills and ~/.codex/skills
|
|
222
|
+
hermes-action install claude-code --print # preview, write nothing
|
|
223
|
+
hermes-action install codex --project-hint # also add a marker block to AGENTS.md
|
|
224
|
+
hermes-action uninstall all
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Install behavior is safe by default: it never modifies `CLAUDE.md` / `AGENTS.md` unless you pass `--project-hint`, refuses to overwrite a file it did not generate, and is idempotent. Use `--project` for a project-local skill and `--dry-run` to preview operations.
|
|
228
|
+
|
|
229
|
+
The generated skill is shown in [`examples/claude-code/SKILL.md`](examples/claude-code/SKILL.md). Project-hint usage is documented in [`examples/claude-code/CLAUDE.md`](examples/claude-code/CLAUDE.md) and [`examples/codex/AGENTS.md`](examples/codex/AGENTS.md).
|
|
230
|
+
|
|
231
|
+
## MCP configuration
|
|
232
|
+
|
|
233
|
+
Print the config snippet for your client (Claude Code / Cursor / VS Code use JSON; Codex uses TOML):
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
hermes-action install mcp
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
For Claude Code, write or merge the project `.mcp.json` directly (preserving other servers):
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
hermes-action install mcp --write
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
Or configure it by hand:
|
|
246
|
+
|
|
247
|
+
```json
|
|
248
|
+
{
|
|
249
|
+
"mcpServers": {
|
|
250
|
+
"hermes-action": {
|
|
251
|
+
"command": "hermes-action",
|
|
252
|
+
"args": ["mcp"]
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
## Direct delegation
|
|
259
|
+
|
|
260
|
+
You can always call the bridge directly, without a skill:
|
|
261
|
+
|
|
262
|
+
```bash
|
|
263
|
+
hermes-action run --mode plan "Ask Hermes what should happen next."
|
|
264
|
+
|
|
265
|
+
hermes-action run \
|
|
266
|
+
--preset coding \
|
|
267
|
+
--context ./codex-notes.md \
|
|
268
|
+
"Use Hermes to validate this plan and identify missing runtime checks."
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
## MCP tools
|
|
272
|
+
|
|
273
|
+
Run:
|
|
274
|
+
|
|
275
|
+
```bash
|
|
276
|
+
hermes-action mcp
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Exposed tools:
|
|
280
|
+
|
|
281
|
+
- `hermes_run`: delegate a request to Hermes.
|
|
282
|
+
- `hermes_plan`: shortcut for `hermes_run` with `mode=plan`.
|
|
283
|
+
- `hermes_presets`: list configured presets.
|
|
284
|
+
- `hermes_status`: check the configured Hermes runtime command.
|
|
285
|
+
|
|
286
|
+
The MCP surface is intentionally small. The bridge delegates to Hermes instead of exposing every Hermes tool one by one.
|
|
287
|
+
|
|
288
|
+
## Development
|
|
289
|
+
|
|
290
|
+
```bash
|
|
291
|
+
npm install
|
|
292
|
+
npm run build
|
|
293
|
+
npm run test
|
|
294
|
+
npm run check
|
|
295
|
+
```
|
|
296
|
+
|
|
297
|
+
Functional tests use a fake Hermes binary to verify command construction, prompt wrapping, risk policy, and YOLO behavior without spending LLM credits.
|
|
298
|
+
|
|
299
|
+
## Documentation
|
|
300
|
+
|
|
301
|
+
- [Architecture](docs/ARCHITECTURE.md): module map, config precedence, modes, policy, and MCP design.
|
|
302
|
+
- [Functional testing](docs/FUNCTIONAL-TESTS.md): automated tests and live smoke-test procedures.
|
|
303
|
+
- [Contributing](CONTRIBUTING.md): local setup, development rules, and release checklist.
|
|
304
|
+
- [Changelog](CHANGELOG.md): release history.
|
|
305
|
+
- [Security policy](SECURITY.md): how to report a vulnerability.
|
|
306
|
+
|
|
307
|
+
## Security notes
|
|
308
|
+
|
|
309
|
+
- Do not put secrets in `.hermes-action.yaml`.
|
|
310
|
+
- Keep provider credentials in Hermes Agent, your OS keychain, or the relevant platform's secure store.
|
|
311
|
+
- Use `request-approval` for public posting, outbound email/messages, deletes, payments, credential changes, and git pushes.
|
|
312
|
+
- Treat `--yolo` as a trusted-local-mode escape hatch, not as a default.
|
|
313
|
+
|
|
314
|
+
## Also by the author
|
|
315
|
+
|
|
316
|
+
Built by Cyril Guilleminot, who also makes offline-first voice tools:
|
|
317
|
+
|
|
318
|
+
- [Weesper Neon Flow](https://weesperneonflow.ai) — speak text into any app at 3× typing speed, fully offline (macOS & Windows).
|
|
319
|
+
- [Weesper Transcribe](https://apps.apple.com/app/id6778776535) — offline transcription on the macOS App Store.
|
|
320
|
+
|
|
321
|
+
## License
|
|
322
|
+
|
|
323
|
+
MIT
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { AdapterResult, BridgeConfig, EffectiveRun } from "../types.js";
|
|
2
|
+
export declare function buildHermesCliArgs(run: EffectiveRun, prompt?: string): string[];
|
|
3
|
+
export declare function runHermesCli(config: BridgeConfig, run: EffectiveRun, dryRun: boolean): Promise<AdapterResult>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { buildHermesPrompt } from "../prompt.js";
|
|
3
|
+
export function buildHermesCliArgs(run, prompt = buildHermesPrompt(run)) {
|
|
4
|
+
const args = ["chat", "-Q", "--source", run.source, "--max-turns", String(run.maxTurns)];
|
|
5
|
+
if (run.profile)
|
|
6
|
+
args.unshift("--profile", run.profile);
|
|
7
|
+
if (run.provider)
|
|
8
|
+
args.push("--provider", run.provider);
|
|
9
|
+
if (run.model)
|
|
10
|
+
args.push("--model", run.model);
|
|
11
|
+
if (run.preset.skills.length)
|
|
12
|
+
args.push("--skills", run.preset.skills.join(","));
|
|
13
|
+
if (run.preset.toolsets.length)
|
|
14
|
+
args.push("--toolsets", run.preset.toolsets.join(","));
|
|
15
|
+
if (run.yolo)
|
|
16
|
+
args.push("--yolo");
|
|
17
|
+
args.push("-q", prompt);
|
|
18
|
+
return args;
|
|
19
|
+
}
|
|
20
|
+
export async function runHermesCli(config, run, dryRun) {
|
|
21
|
+
const prompt = buildHermesPrompt(run);
|
|
22
|
+
const args = buildHermesCliArgs(run, prompt);
|
|
23
|
+
const command = [config.runtime.command, ...args];
|
|
24
|
+
if (dryRun) {
|
|
25
|
+
return { ok: true, exitCode: 0, stdout: JSON.stringify({ command, prompt }, null, 2), stderr: "", command, prompt, dryRun: true };
|
|
26
|
+
}
|
|
27
|
+
return new Promise((resolve) => {
|
|
28
|
+
const child = spawn(config.runtime.command, args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
29
|
+
let stdout = "";
|
|
30
|
+
let stderr = "";
|
|
31
|
+
child.stdout.setEncoding("utf8");
|
|
32
|
+
child.stderr.setEncoding("utf8");
|
|
33
|
+
child.stdout.on("data", (chunk) => {
|
|
34
|
+
stdout += chunk;
|
|
35
|
+
});
|
|
36
|
+
child.stderr.on("data", (chunk) => {
|
|
37
|
+
stderr += chunk;
|
|
38
|
+
});
|
|
39
|
+
child.on("error", (error) => {
|
|
40
|
+
resolve({ ok: false, exitCode: 127, stdout, stderr: `${stderr}${error.message}`, command, prompt, dryRun: false });
|
|
41
|
+
});
|
|
42
|
+
child.on("close", (code) => {
|
|
43
|
+
const exitCode = code ?? 1;
|
|
44
|
+
resolve({ ok: exitCode === 0, exitCode, stdout, stderr, command, prompt, dryRun: false });
|
|
45
|
+
});
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=hermes-cli.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hermes-cli.js","sourceRoot":"","sources":["../../src/adapters/hermes-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,UAAU,kBAAkB,CAAC,GAAiB,EAAE,SAAiB,iBAAiB,CAAC,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