@inline-chat/hermes-agent-adapter 0.0.18 → 0.0.19

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
@@ -31,7 +31,7 @@ Supported:
31
31
  - Cached, privacy-safe sender names/usernames plus chat/thread IDs, selective reply/thread/observed context, and parent-thread context, with first-name/username Markdown mention guidance and current chat/thread links.
32
32
  - OpenClaw-style entity summaries for live turns and tool-fetched history, including mentions, text links, thread links, thread-title links, code/pre blocks, bot commands, and group mentions as untrusted Hermes context.
33
33
  - DM and group policies, user allowlists, group sender allowlists, mention requirements, strict mention mode, allowed chats, and free-response chats.
34
- - Native Inline `/` command-menu sync for Hermes slash commands, including `/threads`, `/follow`, `/unfollow`, `/inline_update`, `/inline_sync`, `/inline_version`, and `/update`; typed slash commands continue to work even if menu sync is disabled or rejected.
34
+ - Native Inline `/` command-menu sync for Hermes slash commands, including `/threads`, `/follow`, `/unfollow`, `/inline_sync`, `/inline_version`, and `/update`; typed slash commands continue to work even if menu sync is disabled or rejected.
35
35
  - Inline-native buttons for clarify prompts, command approvals, slash confirmations, and model selection.
36
36
  - Agent-created `send_message`/`edit_message` button rows with opaque callback data. A callback is acknowledged immediately and becomes a normal Hermes turn naming the source message and exact action fields. The normal response edits that source message and clears omitted buttons; the agent can instead call `edit_message` with replacement buttons and finish with `NO_REPLY` so the explicit edit remains authoritative.
37
37
  - Outbound local photo, video, voice, and document uploads with configurable size caps.
@@ -61,9 +61,8 @@ hermes gateway setup
61
61
 
62
62
  When installation runs as root but the Hermes home belongs to its service user,
63
63
  the installer automatically aligns the plugin directory ownership with that
64
- service user. Subsequent `/inline_update` commands replace the durable plugin
65
- directly; users do not need to maintain a second npm prefix or repeat the
66
- host-side install commands for routine updates.
64
+ service user. Use the same service user and Hermes home when applying manual
65
+ npm updates.
67
66
 
68
67
  Select Inline in the messaging-platform picker. The default path is: go to
69
68
  **Inline → Settings → Bots → Create a new bot**, then paste its token. See the
@@ -157,7 +156,7 @@ uv run ./hermes plugins list --plain --no-bundled
157
156
  Expected local output includes:
158
157
 
159
158
  ```text
160
- enabled user 0.0.18 inline-platform
159
+ enabled user 0.0.19 inline-platform
161
160
  ```
162
161
 
163
162
  ## Update Or Reinstall
@@ -386,17 +385,18 @@ choice. Hermes accepts that form only when the suffix matches its own username,
386
385
  then removes the suffix before command dispatch; commands addressed to another
387
386
  bot are ignored.
388
387
 
389
- Run `/inline_update` to install the newest adapter from the plugin's current
390
- npm release channel. Stable installs continue following `latest`, while
391
- prerelease installs continue following their existing channel such as `alpha`
392
- or `beta`. Before changing files, the command checks the selected release's
393
- minimum Hermes version against the running agent and refuses incompatible or
394
- unverifiable updates. The update runs in the background without exposing the
395
- Inline token to npm, then asks you to run `/restart` so Hermes loads the
396
- installed version. Development symlink installs are left untouched.
397
- Unexpected precheck or installer failures write bounded, credential-redacted
398
- diagnostics to the standard Hermes log stream under the `[inline-update]`
399
- marker, so `hermes logs` and Hermes debug reports can surface the root cause.
388
+ Plugin updates are managed on the Hermes host. For a catalog installation, use
389
+ `hermes plugins update inline-platform` after a new reviewed catalog pin is
390
+ available, then restart the gateway. For an npm installation:
391
+
392
+ ```sh
393
+ npm install -g @inline-chat/hermes-agent-adapter@latest
394
+ inline-hermes install --force
395
+ ```
396
+
397
+ Restart the gateway after refreshing the plugin. Version 0.0.19 removes the
398
+ in-chat updater so the same plugin can comply with the catalog's exact-commit
399
+ trust policy. Hermes's own `/update` command is unchanged.
400
400
 
401
401
  Run `/follow` in an Inline DM, group, or reply thread to explicitly opt into
402
402
  eligible unmentioned activity waking Hermes. Run `/unfollow` to explicitly opt
package/dist/install.js CHANGED
@@ -7212,7 +7212,7 @@ async function inspectInstall(params) {
7212
7212
  warnings.push(message);
7213
7213
  }
7214
7214
  if (targetExists && !activation.installOwnershipAligned) {
7215
- warnings.push("Installed plugin ownership differs from the Hermes home owner; internal /inline_update may fail until inline-hermes install --force repairs it");
7215
+ warnings.push("Installed plugin ownership differs from the Hermes home owner; manual updates may fail until inline-hermes install --force repairs it");
7216
7216
  }
7217
7217
  return {
7218
7218
  ok: installedReady && issues.length === 0,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inline-chat/hermes-agent-adapter",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Hermes Agent platform adapter for Inline, with a native Python plugin and bundled Inline realtime sidecar.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -28,6 +28,8 @@
28
28
  "README.md",
29
29
  "dist/install.d.ts",
30
30
  "dist/install.js",
31
+ "plugin/inline/README.md",
32
+ "plugin/inline/LICENSE",
31
33
  "plugin/inline/__init__.py",
32
34
  "plugin/inline/adapter.py",
33
35
  "plugin/inline/cli.py",
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,56 @@
1
+ # Inline for Hermes Agent
2
+
3
+ Use Hermes from Inline work-chat DMs, chats, and reply threads. The plugin
4
+ connects Hermes to Inline through a bundled Node.js sidecar; it does not install
5
+ npm packages when the gateway starts.
6
+
7
+ ## Requirements
8
+
9
+ - Hermes Agent 0.21.4 or newer.
10
+ - Node.js 20 or newer, available on the gateway host.
11
+ - An Inline bot token. [Create a bot](https://inline.chat/docs/creating-a-bot),
12
+ or use the guided setup below.
13
+
14
+ ## Install and configure
15
+
16
+ Once this entry is available in the Hermes catalog:
17
+
18
+ ```sh
19
+ hermes plugins install inline-platform
20
+ hermes plugins enable inline-platform
21
+ hermes gateway setup
22
+ ```
23
+
24
+ Select **Inline** in gateway setup. It can guide you through bot creation or
25
+ accept an existing token using Hermes's credential storage. Keep tokens out of
26
+ chat messages and command-line arguments.
27
+
28
+ Check configuration and plugin compatibility:
29
+
30
+ ```sh
31
+ hermes inline status --json --check-compatibility
32
+ hermes inline status --json --probe
33
+ hermes gateway status
34
+ ```
35
+
36
+ Start or restart the Hermes gateway through your usual service manager, then
37
+ send the bot a DM in Inline. A successful status probe alone does not prove
38
+ inbound message delivery; confirm that the bot replies.
39
+
40
+ ## Using the plugin
41
+
42
+ - `/threads` configures reply-thread routing.
43
+ - `/follow` and `/unfollow` control explicit chat following.
44
+ - `/inline_sync` republishes Hermes commands and skills to Inline.
45
+ - `/inline_version` reports the loaded plugin version and last catalog sync.
46
+
47
+ Access controls, group mentions, media limits, native message actions, and
48
+ additional setup options are described in the
49
+ [adapter documentation](https://github.com/inline-chat/inline/tree/main/plugins/hermes-agent#readme).
50
+
51
+ The catalog pins an exact reviewed source commit. Update a catalog installation
52
+ with `hermes plugins update inline-platform` after a new pin is accepted, then
53
+ restart the gateway. A newer npm version does not automatically change a
54
+ catalog installation.
55
+
56
+ The plugin is distributed under the Apache-2.0 license; see [LICENSE](LICENSE).
@@ -22,7 +22,6 @@ import signal
22
22
  import socket
23
23
  import subprocess
24
24
  import sys
25
- import threading
26
25
  import time
27
26
  from collections import OrderedDict
28
27
  from datetime import datetime, timezone
@@ -107,15 +106,8 @@ _INLINE_THREADS_COMMAND_DESCRIPTION = "Configure Inline reply-thread routing"
107
106
  _INLINE_THREADS_COMMAND_ARGS = "[status|on|off|auto|reset]"
108
107
  _INLINE_FOLLOW_COMMAND_DESCRIPTION = "Explicitly follow this Inline chat or thread"
109
108
  _INLINE_UNFOLLOW_COMMAND_DESCRIPTION = "Explicitly unfollow this Inline chat or thread"
110
- _INLINE_UPDATE_COMMAND_DESCRIPTION = "Update the Inline Hermes plugin"
111
109
  _INLINE_SYNC_COMMAND_DESCRIPTION = "Resync Inline commands and skills"
112
110
  _INLINE_VERSION_COMMAND_DESCRIPTION = "Show Inline plugin and sync information"
113
- _INLINE_UPDATE_PACKAGE_NAME = "@inline-chat/hermes-agent-adapter"
114
- _INLINE_UPDATE_PRECHECK_TIMEOUT_SECONDS = 30
115
- _INLINE_UPDATE_TIMEOUT_SECONDS = 5 * 60
116
- _INLINE_UPDATE_LOG_MAX_LINES = 80
117
- _INLINE_UPDATE_LOG_MAX_CHARS = 8_000
118
- _INLINE_UPDATE_LOCK = threading.Lock()
119
111
  _INLINE_THREADS_ACTION_PREFIX = "th:"
120
112
  _INLINE_THREADS_ACTION_TTL_SECONDS = 15 * 60
121
113
  _INLINE_THREAD_COMMAND_RE = re.compile(r"^/(?:thread|threads)(?:@[A-Za-z0-9_]+)?(?:\s+(.*))?$", re.IGNORECASE)
@@ -5317,67 +5309,8 @@ def _inline_unfollow_command_handler(raw_args: str = "") -> str:
5317
5309
  return _inline_follow_command_fallback("unfollow", raw_args)
5318
5310
 
5319
5311
 
5320
- def _inline_update_environment() -> Dict[str, str]:
5321
- try:
5322
- from tools.environments.local import _sanitize_subprocess_env
5323
- env = _sanitize_subprocess_env(os.environ.copy())
5324
- except Exception:
5325
- env = os.environ.copy()
5326
- # Hermes cannot know the secret names introduced by every external plugin.
5327
- sensitive_names = ("TOKEN", "SECRET", "PASSWORD", "API_KEY", "AUTHORIZATION")
5328
- for key in list(env):
5329
- if any(name in key.upper() for name in sensitive_names):
5330
- env.pop(key, None)
5331
- return env
5332
-
5333
-
5334
- def _inline_update_log_text(raw: Any, hermes_home: Optional[Path] = None) -> str:
5335
- text = str(raw or "")
5336
- text = re.sub(r"\x1b\[[0-?]*[ -/]*[@-~]", "", text)
5337
- text = re.sub(r"(?i)\b(Bearer\s+)[^\s]+", r"\1[REDACTED]", text)
5338
- text = re.sub(r"(?i)(https?://)[^/\s:@]+:[^@\s/]+@", r"\1[REDACTED]@", text)
5339
- text = re.sub(r"([?&][^=\s&]+)=([^&\s]+)", r"\1=[REDACTED]", text)
5340
- text = re.sub(
5341
- r"(?i)\b([A-Za-z0-9_-]*(?:token|secret|password|api[_-]?key|authorization)[A-Za-z0-9_-]*)\s*([=:])\s*[^\s]+",
5342
- r"\1\2[REDACTED]",
5343
- text,
5344
- )
5345
- sensitive_names = ("TOKEN", "SECRET", "PASSWORD", "API_KEY", "AUTHORIZATION")
5346
- for key, value in os.environ.items():
5347
- if len(value) >= 8 and any(name in key.upper() for name in sensitive_names):
5348
- text = text.replace(value, "[REDACTED]")
5349
- private_paths = []
5350
- if hermes_home:
5351
- private_paths.append((str(hermes_home), "$HERMES_HOME"))
5352
- private_paths.append((str(Path.home()), "~"))
5353
- for path_text, replacement in private_paths:
5354
- if len(path_text) > 1:
5355
- text = text.replace(path_text, replacement)
5356
- text = "".join(char if char in "\n\t" or ord(char) >= 32 else "?" for char in text)
5357
- lines = [line.rstrip() for line in text.splitlines() if line.strip()]
5358
- text = "\n".join(lines[-_INLINE_UPDATE_LOG_MAX_LINES:])
5359
- if len(text) > _INLINE_UPDATE_LOG_MAX_CHARS:
5360
- text = "[earlier output truncated]\n" + text[-_INLINE_UPDATE_LOG_MAX_CHARS:]
5361
- return text or "(no subprocess output)"
5362
-
5363
-
5364
- def _log_inline_update_failure(
5365
- stage: str,
5366
- detail: str,
5367
- *,
5368
- output: Any = None,
5369
- hermes_home: Optional[Path] = None,
5370
- ) -> None:
5371
- diagnostic = f"{detail}\n{output or ''}".strip()
5372
- logger.error(
5373
- "[inline-update] stage=%s failed\n%s",
5374
- stage,
5375
- _inline_update_log_text(diagnostic, hermes_home),
5376
- )
5377
-
5378
-
5379
- def _installed_inline_plugin_version(hermes_home: Path) -> Optional[str]:
5380
- manifest = hermes_home / "plugins" / "inline" / "plugin.yaml"
5312
+ def _installed_inline_plugin_version() -> Optional[str]:
5313
+ manifest = Path(__file__).resolve().with_name("plugin.yaml")
5381
5314
  try:
5382
5315
  text = manifest.read_text(encoding="utf-8")
5383
5316
  except OSError:
@@ -5386,8 +5319,8 @@ def _installed_inline_plugin_version(hermes_home: Path) -> Optional[str]:
5386
5319
  return match.group(1) if match else None
5387
5320
 
5388
5321
 
5389
- def _inline_install_timestamp(hermes_home: Path) -> Optional[str]:
5390
- target = hermes_home / "plugins" / "inline"
5322
+ def _inline_install_timestamp() -> Optional[str]:
5323
+ target = Path(__file__).resolve().parent
5391
5324
  try:
5392
5325
  timestamp = target.lstat().st_ctime
5393
5326
  except OSError:
@@ -5404,21 +5337,13 @@ def _inline_catalog_part_summary(part: Dict[str, Any]) -> str:
5404
5337
 
5405
5338
 
5406
5339
  def _inline_version_text(last_sync: Optional[Dict[str, Any]] = None) -> str:
5407
- hermes_home = Path(os.getenv("HERMES_HOME") or Path.home() / ".hermes").expanduser()
5408
- version = _installed_inline_plugin_version(hermes_home)
5409
- if not version:
5410
- try:
5411
- manifest = Path(__file__).with_name("plugin.yaml").read_text(encoding="utf-8")
5412
- except OSError:
5413
- manifest = ""
5414
- match = re.search(r"(?m)^version:\s*['\"]?([^\s'\"]+)", manifest)
5415
- version = match.group(1) if match else None
5340
+ version = _installed_inline_plugin_version()
5416
5341
  try:
5417
5342
  from hermes_cli import __version__ as hermes_version
5418
5343
  except Exception:
5419
5344
  hermes_version = None
5420
5345
 
5421
- installed_at = _inline_install_timestamp(hermes_home)
5346
+ installed_at = _inline_install_timestamp()
5422
5347
  if last_sync:
5423
5348
  sync_text = (
5424
5349
  f"{last_sync.get('completed_at') or 'unknown'} "
@@ -5437,178 +5362,6 @@ def _inline_version_text(last_sync: Optional[Dict[str, Any]] = None) -> str:
5437
5362
  ])
5438
5363
 
5439
5364
 
5440
- def _inline_update_lane(version: Optional[str]) -> Optional[str]:
5441
- if not version:
5442
- return None
5443
- match = re.fullmatch(r"\d+\.\d+\.\d+(?:-([A-Za-z][A-Za-z0-9-]*)(?:\.[0-9A-Za-z-]+)*)?", version)
5444
- if not match:
5445
- return None
5446
- return match.group(1) or "latest"
5447
-
5448
-
5449
- def _semver_core(version: Any) -> Optional[tuple[int, int, int]]:
5450
- match = re.match(r"^v?(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$", str(version or "").strip())
5451
- if not match:
5452
- return None
5453
- return tuple(int(part) for part in match.groups())
5454
-
5455
-
5456
- def _run_inline_update() -> str:
5457
- if not _INLINE_UPDATE_LOCK.acquire(blocking=False):
5458
- return "An Inline plugin update is already running."
5459
- try:
5460
- return _run_inline_update_locked()
5461
- finally:
5462
- _INLINE_UPDATE_LOCK.release()
5463
-
5464
-
5465
- def _run_inline_update_locked() -> str:
5466
- hermes_home = Path(os.getenv("HERMES_HOME") or Path.home() / ".hermes").expanduser()
5467
- npm_bin = shutil.which("npm")
5468
- if not npm_bin:
5469
- _log_inline_update_failure("precheck", "npm was not found on PATH", hermes_home=hermes_home)
5470
- return "Inline plugin update is unavailable because npm was not found on PATH. Details were written to Hermes logs under `[inline-update]`."
5471
-
5472
- target = hermes_home / "plugins" / "inline"
5473
- if target.is_symlink():
5474
- return (
5475
- "Inline is installed as a development symlink, so automatic update was skipped. "
5476
- "Update the linked source checkout and restart Hermes instead."
5477
- )
5478
-
5479
- installed_version = _installed_inline_plugin_version(hermes_home)
5480
- lane = _inline_update_lane(installed_version)
5481
- if not lane:
5482
- return (
5483
- "Inline plugin update could not determine the installed release channel. "
5484
- "Update it manually with the package version or npm dist-tag you want to follow."
5485
- )
5486
- package_spec = f"{_INLINE_UPDATE_PACKAGE_NAME}@{lane}"
5487
- precheck_command = [npm_bin, "view", package_spec, "--json"]
5488
- try:
5489
- precheck = subprocess.run(
5490
- precheck_command,
5491
- stdout=subprocess.PIPE,
5492
- stderr=subprocess.PIPE,
5493
- text=True,
5494
- timeout=_INLINE_UPDATE_PRECHECK_TIMEOUT_SECONDS,
5495
- check=False,
5496
- env=_inline_update_environment(),
5497
- )
5498
- except subprocess.TimeoutExpired as exc:
5499
- _log_inline_update_failure(
5500
- "precheck",
5501
- "npm view timed out",
5502
- output=f"{exc.stdout or ''}\n{exc.stderr or ''}",
5503
- hermes_home=hermes_home,
5504
- )
5505
- return "Inline plugin compatibility precheck timed out; no update was applied. Details were written to Hermes logs under `[inline-update]`."
5506
- except OSError as exc:
5507
- _log_inline_update_failure("precheck", f"npm view could not start: {exc}", hermes_home=hermes_home)
5508
- return "Inline plugin compatibility precheck could not start; no update was applied. Details were written to Hermes logs under `[inline-update]`."
5509
- if precheck.returncode != 0:
5510
- _log_inline_update_failure(
5511
- "precheck",
5512
- f"npm view exited with code {precheck.returncode} for {package_spec}",
5513
- output=f"{precheck.stdout or ''}\n{precheck.stderr or ''}",
5514
- hermes_home=hermes_home,
5515
- )
5516
- return (
5517
- f"Inline plugin compatibility precheck failed with exit code {precheck.returncode}; "
5518
- "no update was applied. Details were written to Hermes logs under `[inline-update]`."
5519
- )
5520
- try:
5521
- package_metadata = json.loads(precheck.stdout or "{}")
5522
- except (TypeError, json.JSONDecodeError):
5523
- package_metadata = None
5524
- inline_metadata = package_metadata.get("inlineHermes") if isinstance(package_metadata, dict) else None
5525
- candidate_version = package_metadata.get("version") if isinstance(package_metadata, dict) else None
5526
- minimum_hermes = inline_metadata.get("minHermesVersion") if isinstance(inline_metadata, dict) else None
5527
- try:
5528
- from hermes_cli import __version__ as current_hermes
5529
- except Exception:
5530
- current_hermes = None
5531
- current_core = _semver_core(current_hermes)
5532
- minimum_core = _semver_core(minimum_hermes)
5533
- if not candidate_version or not current_core or not minimum_core:
5534
- _log_inline_update_failure(
5535
- "precheck",
5536
- f"invalid compatibility metadata for {package_spec}; current Hermes version={current_hermes!r}",
5537
- output=precheck.stdout,
5538
- hermes_home=hermes_home,
5539
- )
5540
- return (
5541
- "Inline plugin compatibility metadata could not be verified; "
5542
- "no update was applied. Details were written to Hermes logs under `[inline-update]`."
5543
- )
5544
- if current_core < minimum_core:
5545
- return (
5546
- f"Inline plugin `{candidate_version}` requires Hermes `{minimum_hermes}` or newer, "
5547
- f"but this agent is running `{current_hermes}`. Update Hermes first; no plugin update was applied."
5548
- )
5549
-
5550
- command = [
5551
- npm_bin,
5552
- "exec",
5553
- "--yes",
5554
- f"--package={package_spec}",
5555
- "--",
5556
- "inline-hermes",
5557
- "install",
5558
- "--force",
5559
- "--hermes-home",
5560
- str(hermes_home),
5561
- ]
5562
- try:
5563
- result = subprocess.run(
5564
- command,
5565
- stdout=subprocess.PIPE,
5566
- stderr=subprocess.STDOUT,
5567
- text=True,
5568
- timeout=_INLINE_UPDATE_TIMEOUT_SECONDS,
5569
- check=False,
5570
- env=_inline_update_environment(),
5571
- )
5572
- except subprocess.TimeoutExpired as exc:
5573
- _log_inline_update_failure(
5574
- "install",
5575
- f"npm exec timed out for {package_spec}",
5576
- output=exc.stdout,
5577
- hermes_home=hermes_home,
5578
- )
5579
- return (
5580
- "Inline plugin update timed out. Run "
5581
- f"`npm exec --yes --package={package_spec} -- "
5582
- "inline-hermes install --force` on the Hermes host. Details were written to Hermes logs under `[inline-update]`."
5583
- )
5584
- except OSError as exc:
5585
- _log_inline_update_failure("install", f"npm exec could not start: {exc}", hermes_home=hermes_home)
5586
- return "Inline plugin update could not start. Check that npm is installed and usable on the Hermes host. Details were written to Hermes logs under `[inline-update]`."
5587
-
5588
- if result.returncode != 0:
5589
- _log_inline_update_failure(
5590
- "install",
5591
- f"npm exec exited with code {result.returncode} for {package_spec}",
5592
- output=result.stdout,
5593
- hermes_home=hermes_home,
5594
- )
5595
- return (
5596
- f"Inline plugin update failed with exit code {result.returncode}. Run "
5597
- f"`npm exec --yes --package={package_spec} -- "
5598
- "inline-hermes install --force` on the Hermes host. Details were written to Hermes logs under `[inline-update]`."
5599
- )
5600
-
5601
- version = _installed_inline_plugin_version(hermes_home)
5602
- version_text = f" to `{version}`" if version else ""
5603
- return f"Inline plugin updated{version_text} from the `{lane}` channel. Run `/restart` to load the new version."
5604
-
5605
-
5606
- async def _inline_update_command_handler(raw_args: str = "") -> str:
5607
- if str(raw_args or "").strip():
5608
- return "Usage: `/inline_update`"
5609
- return await asyncio.to_thread(_run_inline_update)
5610
-
5611
-
5612
5365
  async def _inline_sync_command_handler(raw_args: str = "") -> str:
5613
5366
  if str(raw_args or "").strip():
5614
5367
  return "Usage: `/inline_sync`"
@@ -5639,11 +5392,6 @@ def _inline_command_specs() -> tuple[_InlineCommandSpec, ...]:
5639
5392
  handler=_inline_unfollow_command_handler,
5640
5393
  description=_INLINE_UNFOLLOW_COMMAND_DESCRIPTION,
5641
5394
  ),
5642
- _InlineCommandSpec(
5643
- name="inline-update",
5644
- handler=_inline_update_command_handler,
5645
- description=_INLINE_UPDATE_COMMAND_DESCRIPTION,
5646
- ),
5647
5395
  _InlineCommandSpec(
5648
5396
  name="inline-sync",
5649
5397
  handler=_inline_sync_command_handler,
@@ -27,7 +27,7 @@ _CLI_INSTALL_URL = "https://inline.chat/cli/install.sh"
27
27
  _MAX_TOKEN_BYTES = 16 * 1024
28
28
  _MAX_PROBE_RESPONSE_BYTES = 64 * 1024
29
29
  _MACHINE_SETUP_PROTOCOL_VERSION = 1
30
- _PROBE_USER_AGENT = "inline-hermes-agent-adapter/0.0.18"
30
+ _PROBE_USER_AGENT = "inline-hermes-agent-adapter/0.0.19"
31
31
  _ENV_REFERENCE_RE = re.compile(r"^\$\{([A-Za-z_][A-Za-z0-9_]*)\}$")
32
32
 
33
33
 
@@ -3,7 +3,7 @@ label: Inline
3
3
  kind: platform
4
4
  provides_tools:
5
5
  - inline
6
- version: 0.0.18
6
+ version: 0.0.19
7
7
  requires_hermes: ">=0.21.4"
8
8
  description: >
9
9
  Inline platform adapter for Hermes Agent. The adapter runs as a native