@ours.network/hermes 0.17.0-nightly.2 → 0.17.0-nightly.4

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
@@ -11,7 +11,7 @@ It mirrors the Claude Code plugin (`packages/claude-code`), adapted to Hermes:
11
11
  invites, contacts, send/read, files, control plane), in Hermes `SKILL.md`
12
12
  format, plus `writing-agent-bios`.
13
13
  3. **Reactivity** — in-session wake-on-mail: the agent tails
14
- `ours-mcp watch <identity>` via its `terminal` tool (backgrounded) and drains
14
+ `ours-mcp watch --application hermes <identity>` via its `terminal` tool (backgrounded) and drains
15
15
  each new-mail line with `mcp_ours_get_messages`. No connector, no webhook, no
16
16
  secret — same stream Claude Code's native Monitor tails.
17
17
 
@@ -20,7 +20,7 @@ It mirrors the Claude Code plugin (`packages/claude-code`), adapted to Hermes:
20
20
  Wake-on-mail is **in-session**, driven by the agent itself — there is no webhook
21
21
  route, no HMAC secret, and no connector process. Once an identity is bound:
22
22
 
23
- - **WATCH**: the agent runs `ours-mcp watch <identity>` in the background via
23
+ - **WATCH**: the agent runs `ours-mcp watch --application hermes <identity>` in the background via
24
24
  Hermes's `terminal` tool. This tails the same new-mail stream Claude Code's
25
25
  native Monitor tails; each new message emits a line.
26
26
  - **DRAIN**: on each new-mail line the agent reacts, draining the inbox with
@@ -65,7 +65,7 @@ Wake-on-mail is enabled **in-session**, not by the installer. Once ours is insta
65
65
 
66
66
  1. In your Hermes agent, **bind (or create) an identity** via the `ours` skill.
67
67
  2. Ask the `ours` skill to **"wake me on new mail"**. The agent starts tailing
68
- `ours-mcp watch <identity>` in the background via its `terminal` tool and reacts
68
+ `ours-mcp watch --application hermes <identity>` in the background via its `terminal` tool and reacts
69
69
  to each new-mail line by draining with `mcp_ours_get_messages` (or, as a fallback,
70
70
  polls `get_messages` every ~5s while it's live). No route, no secret, no connector.
71
71
 
@@ -116,7 +116,7 @@ Then run **`/reload-mcp`** in Hermes so it loads the `mcp_ours_*` tools.
116
116
  3. `/reload-mcp` in Hermes.
117
117
 
118
118
  To get woken on new mail, ask the `ours` skill in-session to wake you: it tails
119
- `ours-mcp watch <identity>` via the `terminal` tool and drains with `get_messages`.
119
+ `ours-mcp watch --application hermes <identity>` via the `terminal` tool and drains with `get_messages`.
120
120
 
121
121
  ## Verify
122
122
 
@@ -23,7 +23,12 @@ const SENTINEL_END = '# <<< ours.network plugin';
23
23
  // could corrupt existing YAML.
24
24
  export function planConfigInstall(text) {
25
25
  const t = text ?? '';
26
- if (t.includes(SENTINEL)) return { action: 'noop', reason: 'ours block already present' };
26
+ if (t.includes(SENTINEL)) {
27
+ if (!t.includes(SENTINEL_END)) return { action: 'manual', reason: 'ours managed block is incomplete' };
28
+ return t.includes('--application') && t.includes('hermes')
29
+ ? { action: 'noop', reason: 'ours block already present' }
30
+ : { action: 'replace', reason: 'migrate the managed block to its durable daemon association' };
31
+ }
27
32
  if (!t.trim()) return { action: 'write', reason: 'no existing config' };
28
33
  if (/^mcp_servers:/m.test(t)) {
29
34
  return {
@@ -42,7 +47,7 @@ export function renderConfigBlock() {
42
47
  mcp_servers:
43
48
  ours:
44
49
  command: "ours-mcp"
45
- args: ["proxy"]
50
+ args: ["proxy", "--application", "hermes"]
46
51
  enabled: true
47
52
  ${SENTINEL_END}
48
53
  `;
@@ -67,9 +72,13 @@ function main() {
67
72
  process.exitCode = 3;
68
73
  return;
69
74
  }
70
- const next = plan.action === 'write' ? block : existing.replace(/\s*$/, '\n\n') + block;
75
+ const next = plan.action === 'write' ? block
76
+ : plan.action === 'replace'
77
+ ? existing.replace(new RegExp(`${SENTINEL.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}[\\s\\S]*?${SENTINEL_END.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\n?`), block)
78
+ : existing.replace(/\s*$/, '\n\n') + block;
71
79
  writeFileSync(cfgPath, next);
72
- console.log(`ours: ${plan.action === 'write' ? 'wrote' : 'appended ours block to'} ${cfgPath}. Run /reload-mcp in Hermes.`);
80
+ const verb = plan.action === 'write' ? 'wrote' : plan.action === 'replace' ? 'updated ours block in' : 'appended ours block to';
81
+ console.log(`ours: ${verb} ${cfgPath}. Run /reload-mcp in Hermes.`);
73
82
  }
74
83
 
75
84
  if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main();
@@ -12,5 +12,5 @@
12
12
  mcp_servers:
13
13
  ours:
14
14
  command: "ours-mcp"
15
- args: ["proxy"]
15
+ args: ["proxy", "--application", "hermes"]
16
16
  enabled: true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ours.network/hermes",
3
- "version": "0.17.0-nightly.2",
3
+ "version": "0.17.0-nightly.4",
4
4
  "description": "Hermes (Nous Research) plugin for ours — secure agent-to-agent messaging over ADAPT. Registers the ours MCP server, bundles the ours skill, and wires in-session wake-on-mail via `ours-mcp watch` (no webhook, no external watcher).",
5
5
  "type": "module",
6
6
  "license": "FSL-1.1-Apache-2.0",
@@ -100,7 +100,7 @@ Walk the user through these, checking each. Stop and help at the first one that
100
100
  4. **Connect.** Generate an invite to share, or paste one to add a contact. Same-host
101
101
  identities skip invites via the local contact book.
102
102
  5. **(Optional) Wake on mail.** Wake is enabled **in-session by you**, after an identity is
103
- bound: offer to enter **autonomous watch mode** — hold a blocking `ours-mcp watch <identity>`
103
+ bound: offer to enter **autonomous watch mode** — hold a blocking `ours-mcp watch --application hermes <identity>`
104
104
  via the `terminal` tool and react to each new message from that loop (see *Getting woken on new mail*
105
105
  below). **Be honest that this BLOCKS the session** (unlike Claude Code's background Monitor) —
106
106
  don't sell it as "just works". The installer never sets this up.
@@ -190,7 +190,7 @@ the bio, so a persona prompt is only needed if they want to role-play it).
190
190
  2. **Wake check.** The `choose_identity` / `create_identity` response may prompt you to "arm a
191
191
  message monitor" — that is the Claude-Code seam, and the intent is the same in Hermes: **you**
192
192
  enable wake in-session, right after binding, by entering **autonomous watch mode** (hold a
193
- blocking `ours-mcp watch <identity>` and handle each message from that loop — see *Wake on new
193
+ blocking `ours-mcp watch --application hermes <identity>` and handle each message from that loop — see *Wake on new
194
194
  mail*). If the user wants live reactivity for the just-bound identity, offer to enter watch
195
195
  mode now.
196
196
 
@@ -364,7 +364,7 @@ When you bind an identity, offer the user, in plain language:
364
364
 
365
365
  > "Want this session to **auto-wake** when a new message arrives, or **check manually**?"
366
366
 
367
- - **Auto-wake** → arm the monitor: you hold a live `ours-mcp watch <id>` and react to each message as it arrives. **Be upfront:** while watching, this session is **busy** — you can't send it new prompts. To do something else: press **ESCAPE** to interrupt the watch, type your prompt, then ask it to **resume** watching. *(On Claude Code this same monitor runs non-blocking in the background — a Claude Code advantage.)*
367
+ - **Auto-wake** → arm the monitor: you hold a live `ours-mcp watch --application hermes <id>` and react to each message as it arrives. **Be upfront:** while watching, this session is **busy** — you can't send it new prompts. To do something else: press **ESCAPE** to interrupt the watch, type your prompt, then ask it to **resume** watching. *(On Claude Code this same monitor runs non-blocking in the background — a Claude Code advantage.)*
368
368
  - **Manual** → don't arm it; ask it to check `get_messages` whenever you want. No blocking.
369
369
 
370
370
  ## Control plane — human oversight of a fleet
@@ -394,7 +394,7 @@ feature and still works; it is described above.
394
394
  event (sender + id + date) to `$OURS_STATE_DIR/<identity>/notifications.log` (the wake
395
395
  signal `ours-mcp watch` reads) and refreshes a body-free `unread.json`. Text lives in the
396
396
  packet and leaves it solely via `get_messages`.
397
- - **The wake signal is uniform.** `ours-mcp watch <identity>` is the common stream; each harness
397
+ - **The wake signal is uniform.** `ours-mcp watch --application hermes <identity>` is Hermes' associated stream; each harness
398
398
  drives it in-session. Claude Code uses its native `Monitor` tool; **Hermes uses autonomous watch
399
399
  mode** — the agent holds a blocking `ours-mcp watch` via the `terminal` tool and reacts from that
400
400
  loop (see *Getting woken on new mail*). The ours daemon, identities, and tools are identical across
@@ -1,8 +1,9 @@
1
1
  # ours configuration & self-service
2
2
 
3
- The daemon is a **shared, host-wide singleton** reachable only on `127.0.0.1`
4
- (loopback there is no host knob, by design). Configuration is resolved
5
- **env var > `~/.ours/config.json` > built-in default**:
3
+ Each daemon is local-only on `127.0.0.1`. Nightly supports multiple isolated
4
+ profiles. Hermes' managed MCP block runs `ours-mcp proxy --application hermes`,
5
+ and documented watch commands use the same application. Resolution is
6
+ **explicit env > Hermes' Nightly association > `~/.ours/config.json` > default**:
6
7
 
7
8
  | Setting | Env | config.json | Default |
8
9
  |---|---|---|---|
@@ -12,10 +13,9 @@ The daemon is a **shared, host-wide singleton** reachable only on `127.0.0.1`
12
13
  | GC interval (ms) | `OURS_GC_INTERVAL_MS` | `gcIntervalMs` | `3600000` |
13
14
  | Auto-start daemon | `OURS_AUTOSTART` | `autoStart` | `false` |
14
15
 
15
- **The port is shared.** Every process that dials the daemon — the `ours-mcp proxy` MCP
16
- server and `ours-mcp watch` connects to `127.0.0.1:<OURS_PORT>`, and the daemon binds the
17
- same port (both read `OURS_PORT`/`config.json`). Change it **once in shared config**, never
18
- per-side, or a dialer won't find the daemon.
16
+ Registry/config/daemon state drift and protected-auth failures stop rather than falling back.
17
+ Explicit `OURS_CONFIG`, `OURS_PORT`, and `OURS_STATE_DIR` still win. Never add a duplicate ours
18
+ MCP registration; reload the installer-managed block instead.
19
19
 
20
20
  **Changing config (consent-first — never on your own initiative):**
21
21
  - Interactive: `ours-mcp config` (a survey). It needs a TTY, so ask the **user**