@harapter/adapter-hermes 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/LICENSE +201 -0
- package/README.md +225 -0
- package/dist/adapter.d.ts +39 -0
- package/dist/adapter.d.ts.map +1 -0
- package/dist/adapter.js +1368 -0
- package/dist/adapter.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -0
- package/dist/protocol.d.ts +120 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +736 -0
- package/dist/protocol.js.map +1 -0
- package/package.json +53 -0
package/LICENSE
ADDED
|
@@ -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 2026 Harapter contributors
|
|
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.
|
package/README.md
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
# `@harapter/adapter-hermes`
|
|
2
|
+
|
|
3
|
+
`@harapter/adapter-hermes` maps the official Hermes Agent API Server HTTP and
|
|
4
|
+
Server-Sent Events interface to the portable Harapter lifecycle.
|
|
5
|
+
|
|
6
|
+
The host installs, configures, authenticates, starts, and stops Hermes Agent.
|
|
7
|
+
The Adapter connects only to a host-selected endpoint. It does not install the
|
|
8
|
+
Hermes Agent Runtime or SDK, start a server, configure models or tools, or own
|
|
9
|
+
the host security policy.
|
|
10
|
+
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm add @harapter/core@next @harapter/adapter-hermes@next
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Runtime prerequisites and compatibility
|
|
18
|
+
|
|
19
|
+
The Adapter targets the current documented API Server interface. Connection
|
|
20
|
+
requires a valid `GET /v1/capabilities` document with the Session creation,
|
|
21
|
+
Session lookup, Run submission, Run status, and Run event routes used by the
|
|
22
|
+
Adapter. Stop and approval support are declared only when the connected server
|
|
23
|
+
advertises the corresponding feature and exact route.
|
|
24
|
+
|
|
25
|
+
Every response and SSE event used for portable lifecycle authority is
|
|
26
|
+
structurally validated. A stable diagnostic fingerprint is derived from the
|
|
27
|
+
validated capability subset. Harapter does not pin the Hermes executable to a
|
|
28
|
+
release number or use its identity to infer capabilities. Incompatible current
|
|
29
|
+
or future response shapes fail closed at the boundary where they are used.
|
|
30
|
+
|
|
31
|
+
The fixture manifest records the upstream source revision inspected for the
|
|
32
|
+
evidence baseline. That revision is provenance, not a runtime allowlist. Hermes
|
|
33
|
+
Agent is MIT licensed; Harapter does not redistribute it. See the
|
|
34
|
+
[license record](../../licenses/hermes-agent.md).
|
|
35
|
+
|
|
36
|
+
The latest trusted live validation ran on 2026-09-03 against
|
|
37
|
+
`hermes-agent@0.21.0` from
|
|
38
|
+
`nousresearch/hermes-agent@sha256:023d61b3ec803093827e10999e54abdbd379d1ed6adba59b45a6b89c1b4233b8`.
|
|
39
|
+
The [passing workflow run][hermes-live-2026-09-03] verified an exact completed
|
|
40
|
+
text response with `run.started`, `message.completed`, and authoritative
|
|
41
|
+
`run.completed` Events. It then closed the first local handle, resumed the same
|
|
42
|
+
native Session, and verified native cancellation of a second Run with an
|
|
43
|
+
authoritative `run.cancelled` terminal. Both local Session handles and the
|
|
44
|
+
Client were disposed, and no model-facing toolset was enabled. The API Server
|
|
45
|
+
does not negotiate a Runtime compatibility version, so the Adapter remains
|
|
46
|
+
`experimental`. Harapter attempts other Runtime releases and rejects
|
|
47
|
+
incompatible response or event shapes when they are used; it does not reject a
|
|
48
|
+
release by version number alone.
|
|
49
|
+
|
|
50
|
+
[hermes-live-2026-09-03]:
|
|
51
|
+
https://github.com/yunfeizhu/harapter/actions/runs/33737478620
|
|
52
|
+
|
|
53
|
+
## Profile and authentication
|
|
54
|
+
|
|
55
|
+
Hermes Agent uses an `endpoint` Profile with HTTP transport and host or external
|
|
56
|
+
ownership:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
import { HarnessRegistry, profileId } from '@harapter/core';
|
|
60
|
+
import {
|
|
61
|
+
HERMES_PROVIDER_ID,
|
|
62
|
+
createHermesProviderFactory,
|
|
63
|
+
} from '@harapter/adapter-hermes';
|
|
64
|
+
|
|
65
|
+
const registry = new HarnessRegistry();
|
|
66
|
+
registry.register(
|
|
67
|
+
createHermesProviderFactory({
|
|
68
|
+
resolveAuthHeaders: async (reference) => headersFor(reference),
|
|
69
|
+
}),
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
const client = await registry.connect({
|
|
73
|
+
profileId: profileId('hermes-local'),
|
|
74
|
+
providerId: HERMES_PROVIDER_ID,
|
|
75
|
+
displayName: 'Hermes Agent',
|
|
76
|
+
connection: {
|
|
77
|
+
kind: 'endpoint',
|
|
78
|
+
url: 'http://127.0.0.1:8642/',
|
|
79
|
+
transport: 'http',
|
|
80
|
+
ownership: 'host',
|
|
81
|
+
authRef: { scheme: 'host-secret-store', id: 'hermes-api-key' },
|
|
82
|
+
},
|
|
83
|
+
});
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
`authRef` is optional. When it is present, the host must provide
|
|
87
|
+
`resolveAuthHeaders`. Harapter does not resolve, log, persist, or expose the
|
|
88
|
+
header values.
|
|
89
|
+
|
|
90
|
+
Profile `providerOptions` accepts positive bounded values for
|
|
91
|
+
`requestTimeoutMs`, `sseConnectTimeoutMs`, `reconcileTimeoutMs`,
|
|
92
|
+
`reconcilePollIntervalMs`, `cancelSettlementTimeoutMs`,
|
|
93
|
+
`lateEventDrainTimeoutMs`, and `maxRunEvents`. Unknown options are rejected.
|
|
94
|
+
`maxRunEvents` must be between 2 and 4096 so the unread event queue always
|
|
95
|
+
reserves terminal capacity.
|
|
96
|
+
|
|
97
|
+
## Session and Run lifecycle
|
|
98
|
+
|
|
99
|
+
`createSession()` uses the documented Session creation route. Portable system
|
|
100
|
+
context and model selection are sent at creation and retained as bounded,
|
|
101
|
+
non-secret provider state. Native model settings use
|
|
102
|
+
`model.providerOptions.provider` and `model.providerOptions.modelOptions`;
|
|
103
|
+
credential-shaped option keys are rejected. Native `modelOptions` are applied to
|
|
104
|
+
the creating Session handle but omitted from `SessionRef.providerState`; a
|
|
105
|
+
resumed handle relies on the native Hermes Session state.
|
|
106
|
+
|
|
107
|
+
`resumeSession()` validates the Provider, Profile, compatibility reference,
|
|
108
|
+
native Session identifier, retained state, and remote Session response before
|
|
109
|
+
returning a handle. Session state is bound to the connection Profile that
|
|
110
|
+
created it and does not imply checkpoint portability. Portable workspace
|
|
111
|
+
selection is unsupported. `session.close()` releases the local handle and aborts
|
|
112
|
+
active local observation; it does not delete the upstream Session.
|
|
113
|
+
|
|
114
|
+
One Run may be active per Session. Portable Runs accept text parts only. Run
|
|
115
|
+
submission returns an acknowledgement. Before opening SSE, the Adapter validates
|
|
116
|
+
that the acknowledged Run status belongs to the submitting Session. It then
|
|
117
|
+
consumes the bounded stream and reconciles lifecycle evidence against
|
|
118
|
+
`GET /v1/runs/{run_id}`. Non-empty Session, input, and Run metadata are rejected
|
|
119
|
+
because the current API mapping has no documented portable destination for them.
|
|
120
|
+
The status route is the terminal authority:
|
|
121
|
+
|
|
122
|
+
- `completed` maps to `run.completed` only with matching Run and Session
|
|
123
|
+
ownership plus `last_event: "run.completed"`;
|
|
124
|
+
- `failed` maps to `run.failed` without exposing the Provider failure body;
|
|
125
|
+
- `cancelled` maps to `run.cancelled` only from authoritative Provider status;
|
|
126
|
+
- `queued`, `running`, `waiting_for_approval`, and `stopping` remain
|
|
127
|
+
nonterminal;
|
|
128
|
+
- SSE EOF, disconnect, malformed data, duplicate terminals, or contradictory
|
|
129
|
+
evidence never become success.
|
|
130
|
+
|
|
131
|
+
After terminal evidence, the Adapter drains only for a bounded interval to
|
|
132
|
+
detect contradictory or duplicate lifecycle events. A terminal portable event is
|
|
133
|
+
always the last event in the parent Run trace. Malformed or uncertain settlement
|
|
134
|
+
quarantines the Session handle within the Client until the host performs
|
|
135
|
+
explicit recovery through a new connection.
|
|
136
|
+
|
|
137
|
+
Run submission, stop, and approval are non-idempotent mutations. A malformed
|
|
138
|
+
success response, server failure, response loss, or ownership mismatch after
|
|
139
|
+
possible execution quarantines the affected Session instead of reopening it for
|
|
140
|
+
an unsafe retry.
|
|
141
|
+
|
|
142
|
+
## Stop, timeout, and approval
|
|
143
|
+
|
|
144
|
+
When the capability handshake advertises the official stop route, `run.cancel()`
|
|
145
|
+
posts to it. A `stopping` response is only an acknowledgement; Harapter reports
|
|
146
|
+
native cancellation after authoritative `cancelled` evidence. If settlement
|
|
147
|
+
remains uncertain, the result is `connection_aborted`, not `run.cancelled`.
|
|
148
|
+
Without the advertised route, portable cancellation is unsupported.
|
|
149
|
+
|
|
150
|
+
A positive `RunOptions.timeoutMs` uses native stop when available. Otherwise it
|
|
151
|
+
aborts only the Adapter connection. Client close, Session close, HTTP abort, and
|
|
152
|
+
SSE loss are connection lifecycle events and never proof of native cancellation.
|
|
153
|
+
|
|
154
|
+
Advertised approval requests map to portable approval interactions. Approval
|
|
155
|
+
supports `once`, `session`, and `always`; denial maps to `deny`. Overlapping
|
|
156
|
+
requests, an approval event without advertised support, or a mismatched
|
|
157
|
+
acknowledgement fails closed. Matching HTTP acknowledgement and SSE resolution
|
|
158
|
+
evidence is accepted in either arrival order and produces one portable
|
|
159
|
+
resolution.
|
|
160
|
+
|
|
161
|
+
## Events, extensions, and native access
|
|
162
|
+
|
|
163
|
+
Message deltas, Tool lifecycle, reasoning, usage, approval, and terminal events
|
|
164
|
+
map to portable events. Unknown upstream events remain observable through a
|
|
165
|
+
bounded, content-free `provider` event and
|
|
166
|
+
`HermesNativeClient.onUnknownEvent()`. Raw observation limits depth, node count,
|
|
167
|
+
array length, and object fields; arbitrary scalar content and unknown fields are
|
|
168
|
+
not exposed.
|
|
169
|
+
|
|
170
|
+
`nous.hermes-agent.subagents` is a typed observer for bounded child-Session
|
|
171
|
+
events. The current capability document does not advertise this event family, so
|
|
172
|
+
its capability status remains `unknown`. A child event received before the
|
|
173
|
+
parent terminal boundary can also appear as a parent Provider event. A late
|
|
174
|
+
child event is delivered only to the extension and cannot append to, delay, or
|
|
175
|
+
rewrite the terminated parent Run.
|
|
176
|
+
|
|
177
|
+
`client.native()` returns a `HermesNativeClient` with endpoint-bound JSON
|
|
178
|
+
requests, the non-sensitive compatibility identity, and unknown-event
|
|
179
|
+
observation. Native requests remain Provider-specific and do not gain portable
|
|
180
|
+
ordering, ownership, lifecycle, redaction, or authorization guarantees.
|
|
181
|
+
|
|
182
|
+
## Evidence and limitations
|
|
183
|
+
|
|
184
|
+
Evidence for this experimental Adapter includes:
|
|
185
|
+
|
|
186
|
+
- deterministic synthetic capability, completed, failed, cancelled, approval,
|
|
187
|
+
late-child, and unknown-event fixtures in
|
|
188
|
+
[`fixtures/hermes/api-server-current`](../../fixtures/hermes/api-server-current/manifest.json);
|
|
189
|
+
- mapping, ownership, malformed-input, authentication, timeout, stop,
|
|
190
|
+
disconnect, terminal reconciliation, event-bound, approval, observer, and
|
|
191
|
+
native-access tests;
|
|
192
|
+
- the shared portable Provider conformance suite;
|
|
193
|
+
- an opt-in live-runtime test for a host-operated endpoint;
|
|
194
|
+
- a trusted live-canary path that pulls the current official container, records
|
|
195
|
+
its package version and immutable image digest, and exercises Session, Run,
|
|
196
|
+
SSE, terminal-result, and disposal behavior.
|
|
197
|
+
|
|
198
|
+
Run live verification only against an isolated endpoint whose work and cost are
|
|
199
|
+
acceptable to the host:
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
HARAPTER_HERMES_LIVE=1 \
|
|
203
|
+
HARAPTER_HERMES_ENDPOINT=http://127.0.0.1:8642/ \
|
|
204
|
+
pnpm vitest run providers/hermes/test/live.test.ts
|
|
205
|
+
```
|
|
206
|
+
|
|
207
|
+
Set `HARAPTER_HERMES_API_KEY` when the endpoint requires bearer authentication.
|
|
208
|
+
The live test logs no Provider traffic. A skipped or unrecorded live test is not
|
|
209
|
+
support evidence.
|
|
210
|
+
|
|
211
|
+
The repository live canary mounts only an isolated temporary data directory and
|
|
212
|
+
publishes the API Server on host loopback. It disables bundled skills, plugins,
|
|
213
|
+
MCP servers, memory, compression, checkpoints, title generation, background
|
|
214
|
+
review, and every API Server toolset. An authenticated toolset inventory must
|
|
215
|
+
confirm that every configurable toolset is disabled, and the Runtime's full
|
|
216
|
+
Agent-side resolver must return no enabled toolsets, before the canary submits
|
|
217
|
+
two synthetic Prompts. The first requires one exact text response and validates
|
|
218
|
+
the completed lifecycle. After closing and resuming the same native Session, the
|
|
219
|
+
second requests a deliberately long response so the canary can require native
|
|
220
|
+
cancellation and an authoritative cancelled terminal. The weekly schedule is
|
|
221
|
+
enabled after the passing manual run recorded above.
|
|
222
|
+
|
|
223
|
+
Portable workspace selection, file and image input, Server lifecycle, Session
|
|
224
|
+
deletion, automatic SSE reconnection, and strict child-Session capability claims
|
|
225
|
+
are outside the current compatibility boundary.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type ProviderAdapterFactory, type SecretRef } from '@harapter/core';
|
|
2
|
+
import { type HttpHeaderMap, type HttpMethod } from '@harapter/transport-http-sse';
|
|
3
|
+
import { type HermesRawEvent } from './protocol.js';
|
|
4
|
+
/** Host integrations available while creating a Hermes Adapter. */
|
|
5
|
+
export interface HermesProviderFactoryOptions {
|
|
6
|
+
readonly fetch?: typeof fetch;
|
|
7
|
+
readonly resolveAuthHeaders?: (reference: SecretRef) => Promise<HttpHeaderMap> | HttpHeaderMap;
|
|
8
|
+
}
|
|
9
|
+
/** Supported bounded controls in a Hermes Profile providerOptions object. */
|
|
10
|
+
export interface HermesProfileOptions {
|
|
11
|
+
readonly cancelSettlementTimeoutMs?: number;
|
|
12
|
+
readonly lateEventDrainTimeoutMs?: number;
|
|
13
|
+
readonly maxRunEvents?: number;
|
|
14
|
+
readonly reconcilePollIntervalMs?: number;
|
|
15
|
+
readonly reconcileTimeoutMs?: number;
|
|
16
|
+
readonly requestTimeoutMs?: number;
|
|
17
|
+
readonly sseConnectTimeoutMs?: number;
|
|
18
|
+
}
|
|
19
|
+
/** Options for an explicit Provider-native bounded request. */
|
|
20
|
+
export interface HermesNativeRequestOptions {
|
|
21
|
+
readonly body?: unknown;
|
|
22
|
+
readonly method?: HttpMethod;
|
|
23
|
+
readonly signal?: AbortSignal;
|
|
24
|
+
readonly timeoutMs?: number;
|
|
25
|
+
}
|
|
26
|
+
/** Bounded JSON response returned by the native HTTP escape hatch. */
|
|
27
|
+
export interface HermesNativeResponse<T = unknown> {
|
|
28
|
+
readonly body: T;
|
|
29
|
+
readonly status: number;
|
|
30
|
+
}
|
|
31
|
+
/** Provider-bound access to the official API Server HTTP surface. */
|
|
32
|
+
export interface HermesNativeClient {
|
|
33
|
+
readonly runtimeIdentity: string;
|
|
34
|
+
request<T = unknown>(path: string, options?: HermesNativeRequestOptions): Promise<HermesNativeResponse<T>>;
|
|
35
|
+
onUnknownEvent(listener: (event: HermesRawEvent) => void): () => void;
|
|
36
|
+
}
|
|
37
|
+
/** Create a fresh Hermes Agent API Server Adapter factory. */
|
|
38
|
+
export declare function createHermesProviderFactory(options?: HermesProviderFactoryOptions): ProviderAdapterFactory;
|
|
39
|
+
//# sourceMappingURL=adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../src/adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAmBL,KAAK,sBAAsB,EAM3B,KAAK,SAAS,EAEf,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,UAAU,EAIhB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAkBL,KAAK,cAAc,EAIpB,MAAM,eAAe,CAAC;AA2BvB,mEAAmE;AACnE,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,CAAC,EAAE,CAC5B,SAAS,EAAE,SAAS,KACjB,OAAO,CAAC,aAAa,CAAC,GAAG,aAAa,CAAC;CAC7C;AAED,6EAA6E;AAC7E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,yBAAyB,CAAC,EAAE,MAAM,CAAC;IAC5C,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,mBAAmB,CAAC,EAAE,MAAM,CAAC;CACvC;AAED,+DAA+D;AAC/D,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,CAAC;IAC9B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,sEAAsE;AACtE,MAAM,WAAW,oBAAoB,CAAC,CAAC,GAAG,OAAO;IAC/C,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;IACjB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,qEAAqE;AACrE,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,OAAO,CAAC,CAAC,GAAG,OAAO,EACjB,IAAI,EAAE,MAAM,EACZ,OAAO,CAAC,EAAE,0BAA0B,GACnC,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,CAAC;IACpC,cAAc,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,GAAG,MAAM,IAAI,CAAC;CACvE;AA0BD,8DAA8D;AAC9D,wBAAgB,2BAA2B,CACzC,OAAO,GAAE,4BAAiC,GACzC,sBAAsB,CAQxB"}
|