@hivemagnus/ardent 0.0.0-stage → 1.0.2
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 +202 -0
- package/README.md +274 -2
- package/dist/a2a-client.d.ts +35 -0
- package/dist/a2a-client.js +172 -0
- package/dist/a2a-hermes-alias.d.ts +3 -0
- package/dist/a2a-hermes-alias.js +57 -0
- package/dist/a2a-idempotency.d.ts +13 -0
- package/dist/a2a-idempotency.js +86 -0
- package/dist/a2a-peers.d.ts +28 -0
- package/dist/a2a-peers.js +108 -0
- package/dist/a2a-push-inbox.d.ts +22 -0
- package/dist/a2a-push-inbox.js +84 -0
- package/dist/a2a-push.d.ts +27 -0
- package/dist/a2a-push.js +188 -0
- package/dist/a2a-server.d.ts +37 -0
- package/dist/a2a-server.js +186 -0
- package/dist/a2a-store.d.ts +10 -0
- package/dist/a2a-store.js +122 -0
- package/dist/a2a.d.ts +19 -0
- package/dist/a2a.js +466 -0
- package/dist/api.d.ts +6 -0
- package/dist/api.js +381 -0
- package/dist/artifacts.d.ts +15 -0
- package/dist/artifacts.js +41 -0
- package/dist/backend-events.d.ts +49 -0
- package/dist/backend-events.js +8 -0
- package/dist/channels.d.ts +52 -0
- package/dist/channels.js +184 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +845 -0
- package/dist/codex-output-budget.d.ts +17 -0
- package/dist/codex-output-budget.js +31 -0
- package/dist/codex-output-budget.test.d.ts +1 -0
- package/dist/codex-output-budget.test.js +29 -0
- package/dist/codex.d.ts +82 -0
- package/dist/codex.js +431 -0
- package/dist/config.d.ts +171 -0
- package/dist/config.js +244 -0
- package/dist/context-checkpoints.d.ts +49 -0
- package/dist/context-checkpoints.js +248 -0
- package/dist/context.d.ts +16 -0
- package/dist/context.js +101 -0
- package/dist/gateway-lock.d.ts +18 -0
- package/dist/gateway-lock.js +104 -0
- package/dist/hermes-compat.d.ts +15 -0
- package/dist/hermes-compat.js +62 -0
- package/dist/identity.d.ts +15 -0
- package/dist/identity.js +52 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +8 -0
- package/dist/job-engine.d.ts +222 -0
- package/dist/job-engine.js +497 -0
- package/dist/job-news-handlers.d.ts +54 -0
- package/dist/job-news-handlers.js +153 -0
- package/dist/job-ownership.d.ts +9 -0
- package/dist/job-ownership.js +17 -0
- package/dist/json-schema.d.ts +9 -0
- package/dist/json-schema.js +20 -0
- package/dist/llamacpp.d.ts +49 -0
- package/dist/llamacpp.js +216 -0
- package/dist/magnus-control.d.ts +3 -0
- package/dist/magnus-control.js +99 -0
- package/dist/magnus-node-dependency-impact.d.ts +1 -0
- package/dist/magnus-node-dependency-impact.js +126 -0
- package/dist/magnus-owner-reads.d.ts +4 -0
- package/dist/magnus-owner-reads.js +99 -0
- package/dist/magnus-readiness.d.ts +1 -0
- package/dist/magnus-readiness.js +108 -0
- package/dist/mattermost.d.ts +18 -0
- package/dist/mattermost.js +303 -0
- package/dist/memory-tools.d.ts +5 -0
- package/dist/memory-tools.js +49 -0
- package/dist/memory.d.ts +40 -0
- package/dist/memory.js +128 -0
- package/dist/model-policy.d.ts +64 -0
- package/dist/model-policy.js +56 -0
- package/dist/news.d.ts +10 -0
- package/dist/news.js +291 -0
- package/dist/owner-read.d.ts +32 -0
- package/dist/owner-read.js +130 -0
- package/dist/plugins.d.ts +74 -0
- package/dist/plugins.js +115 -0
- package/dist/research.d.ts +110 -0
- package/dist/research.js +164 -0
- package/dist/runtime.d.ts +33 -0
- package/dist/runtime.js +665 -0
- package/dist/skills.d.ts +13 -0
- package/dist/skills.js +87 -0
- package/dist/store.d.ts +142 -0
- package/dist/store.js +322 -0
- package/dist/team-artifacts.d.ts +138 -0
- package/dist/team-artifacts.js +241 -0
- package/dist/team-child.d.ts +21 -0
- package/dist/team-child.js +130 -0
- package/dist/team-contract.d.ts +116 -0
- package/dist/team-contract.js +84 -0
- package/dist/team-control.d.ts +8 -0
- package/dist/team-control.js +152 -0
- package/dist/telegram.d.ts +35 -0
- package/dist/telegram.js +284 -0
- package/dist/tools.d.ts +48 -0
- package/dist/tools.js +58 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +5 -0
- package/model-policy.default.json +20 -0
- package/package.json +84 -4
- package/profiles/assistant/IDENTITY.md +9 -0
- package/profiles/assistant/SOUL.md +8 -0
- package/profiles/assistant/config.yaml +88 -0
- package/profiles/assistant/peers.yaml +12 -0
- package/profiles/assistant/skills/grounded-answers/SKILL.md +18 -0
- package/protocol/LICENSE-A2A.txt +202 -0
- package/protocol/README.md +12 -0
- package/protocol/a2a.proto +811 -0
- package/protocol/lock.json +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,275 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ardent
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Ardent is a headless TypeScript agent runtime. One process serves one
|
|
4
|
+
**profile**: a directory with a YAML config, a persona (`SOUL.md`,
|
|
5
|
+
`IDENTITY.md`), skills, and private SQLite state. Ardent runs model turns
|
|
6
|
+
against an OpenAI-compatible chat server (llama.cpp, vLLM, ...) or the Codex
|
|
7
|
+
App Server, calls typed tools, and keeps a durable journal of every task.
|
|
8
|
+
|
|
9
|
+
What you get:
|
|
10
|
+
|
|
11
|
+
- **Durable tasks** with idempotency keys, cancellation, deadlines, and a
|
|
12
|
+
per-task event journal in SQLite. Interrupted work is marked `unknown`,
|
|
13
|
+
never silently replayed.
|
|
14
|
+
- **Management API** (Hono, bearer-token protected) for tasks, sessions,
|
|
15
|
+
config, identity, skills, peers, channels, and live event streams. The
|
|
16
|
+
OpenAPI document is served at `/openapi.json` and pinned in
|
|
17
|
+
[`openapi/ardent.json`](openapi/ardent.json).
|
|
18
|
+
- **A2A protocol 1.0** server and client over JSON-RPC, HTTP+JSON, and gRPC,
|
|
19
|
+
with authenticated peers, push notifications, and bounded "team missions"
|
|
20
|
+
that scope which tools a peer may reach.
|
|
21
|
+
- **Scheduled jobs** (cron with IANA timezones, or fixed intervals) with
|
|
22
|
+
exactly-once window receipts.
|
|
23
|
+
- **Skills**: Markdown working methods the model can read on demand.
|
|
24
|
+
- **Context compaction** for long sessions, driven by a model policy file.
|
|
25
|
+
- **Optional integrations**: news research (SearXNG + Firecrawl), HiveMem
|
|
26
|
+
long-term memory, Telegram and Mattermost chat channels, read-only Magnus
|
|
27
|
+
Control tools, and Hermes Agent team-card compatibility. Each one is off
|
|
28
|
+
until you configure it.
|
|
29
|
+
- **Plugins**: add tools, API routes, CLI commands, and job handlers from a
|
|
30
|
+
separate npm package.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
Ardent needs Node.js 24.22.1+ or 26.13.0+ (`better-sqlite3` is a native
|
|
35
|
+
dependency).
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm i -g @hivemagnus/ardent
|
|
39
|
+
ardent init --non-interactive # creates ~/.ardent/profiles/assistant
|
|
40
|
+
ardent doctor # lists unresolved configuration
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`init` copies the bundled `assistant` template, sets the profile timezone to
|
|
44
|
+
the host's zone, and writes a random management token to the profile's
|
|
45
|
+
`.env`. Use `--profile NAME` (or `--profile-path /abs/dir`) to create and
|
|
46
|
+
select other profiles, and `--api-port N` to choose the management port.
|
|
47
|
+
`ARDENT_HOME` overrides the `~/.ardent` root.
|
|
48
|
+
|
|
49
|
+
Point the profile at a model, then talk to it:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
cat >> ~/.ardent/profiles/assistant/.env <<'EOF'
|
|
53
|
+
ARDENT_LLAMA_BASE_URL=http://127.0.0.1:8080/
|
|
54
|
+
ARDENT_LLAMA_MODEL=your-model-name
|
|
55
|
+
EOF
|
|
56
|
+
ardent chat # interactive session
|
|
57
|
+
ardent run --prompt "Summarize RFC 9110 in three bullets"
|
|
58
|
+
ardent gateway run # management API, A2A, channels, jobs
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
`ardent help` lists every command.
|
|
62
|
+
|
|
63
|
+
## Configuration
|
|
64
|
+
|
|
65
|
+
`config.yaml` (schema 1) is validated strictly; unknown keys are rejected. A
|
|
66
|
+
string of the form `${NAME}` is resolved from the environment (the profile
|
|
67
|
+
`.env` is loaded automatically). Secrets are never written to the config,
|
|
68
|
+
only the *names* of the environment variables that hold them.
|
|
69
|
+
|
|
70
|
+
| Key | Default | Notes |
|
|
71
|
+
|---|---|---|
|
|
72
|
+
| `profile`, `name` | required | Profile ID and display name. |
|
|
73
|
+
| `product` | `Ardent` | Shown in the profile summary. |
|
|
74
|
+
| `timezone` | host zone, else `UTC` | IANA zone used for dates shown to the model. Job schedules carry their own zone. |
|
|
75
|
+
| `identity.soul_file`, `identity.identity_file` | `SOUL.md`, `IDENTITY.md` | Persona files in the profile. |
|
|
76
|
+
| `execution` | required | `backend: llamacpp \| codex`, step, tool-call, parallelism, and deadline limits. |
|
|
77
|
+
| `providers.llamacpp` | required | `base_url`, `model`, `api_key_env`, `request_timeout_seconds`, optional `context_window_tokens`, `max_output_tokens`, `reasoning_effort`. |
|
|
78
|
+
| `providers.codex` | required | `command`, `model`, `auth_mode: chatgpt \| api_key` (default `chatgpt`); `approval_policy: never` and `sandbox: read-only` are fixed. |
|
|
79
|
+
| `memory` | `{ provider: none }` | See [HiveMem](#hivemem-memory). |
|
|
80
|
+
| `research` | disabled | `enabled`, `searxng_url`, `firecrawl_url`, `firecrawl_token_env`. Enables the `news_search`, `news_article`, `news_collect`, and `news_capabilities` tools. |
|
|
81
|
+
| `skills` | `directories: [skills]`, `enabled: []` | Only enabled skills are shown to the model. |
|
|
82
|
+
| `a2a` | disabled | See [A2A](#a2a). |
|
|
83
|
+
| `channels.telegram`, `channels.mattermost` | disabled | See [Chat channels](#chat-channels). |
|
|
84
|
+
| `integrations.magnus_control` | disabled | See [Magnus Control tools](#magnus-control-tools). |
|
|
85
|
+
| `plugins` | `[]` | See [Plugins](#plugins). |
|
|
86
|
+
| `api` | `127.0.0.1:9910`, `ARDENT_API_TOKEN` | Management listener and the env var holding its bearer token. A non-loopback host is refused; put a TLS proxy in front instead. |
|
|
87
|
+
|
|
88
|
+
`ardent config schema` prints the full JSON Schema, and `ardent config
|
|
89
|
+
validate` checks a profile without starting it.
|
|
90
|
+
|
|
91
|
+
### HiveMem memory
|
|
92
|
+
|
|
93
|
+
Memory is off by default. To use a HiveMem server:
|
|
94
|
+
|
|
95
|
+
```yaml
|
|
96
|
+
memory:
|
|
97
|
+
provider: hivemem
|
|
98
|
+
base_url: ${HIVEMEM_API_URL}
|
|
99
|
+
token_env: HIVEMEM_TOKEN
|
|
100
|
+
agent_id: assistant
|
|
101
|
+
workspace_id: ${HIVEMEM_WORKSPACE}
|
|
102
|
+
default_scope: private
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Direct conversations then get `hivemem_status`, `hivemem_search`,
|
|
106
|
+
`hivemem_browse`, and explicit write tools. Peers never read private memory; a
|
|
107
|
+
validated team mission may grant read access to one shared `project:<id>`
|
|
108
|
+
scope.
|
|
109
|
+
|
|
110
|
+
### Chat channels
|
|
111
|
+
|
|
112
|
+
```yaml
|
|
113
|
+
channels:
|
|
114
|
+
telegram:
|
|
115
|
+
enabled: true
|
|
116
|
+
token_env: TELEGRAM_BOT_TOKEN
|
|
117
|
+
allowed_user_ids: [123456789] # only these users are answered
|
|
118
|
+
mattermost:
|
|
119
|
+
enabled: true
|
|
120
|
+
base_url: ${MATTERMOST_URL} # e.g. https://chat.example.com
|
|
121
|
+
token_env: MATTERMOST_TOKEN
|
|
122
|
+
allowed_user_ids: [user-id]
|
|
123
|
+
require_mention: true
|
|
124
|
+
reply_mode: thread # thread | flat
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
Telegram uses long polling; Mattermost uses its v4 REST and WebSocket APIs.
|
|
128
|
+
Both support `/help`, `/new`, `/status`, `/jobs`, `/model`, `/stop`, `/tasks`,
|
|
129
|
+
and `/sources`. Each inbound message and outbound reply is journaled, so a
|
|
130
|
+
restart never sends the same reply twice.
|
|
131
|
+
|
|
132
|
+
### A2A
|
|
133
|
+
|
|
134
|
+
```yaml
|
|
135
|
+
a2a:
|
|
136
|
+
enabled: true
|
|
137
|
+
bindings: [jsonrpc, http-json, grpc]
|
|
138
|
+
public_url: ${ARDENT_A2A_PUBLIC_URL} # advertised origin, e.g. https://agent.example.com:9900
|
|
139
|
+
listen_host: 127.0.0.1
|
|
140
|
+
listen_port: 9900 # gRPC listens on listen_port + 1
|
|
141
|
+
peers_file: peers.yaml
|
|
142
|
+
skill: { id: research, name: Research, description: Sourced answers, tags: [research] }
|
|
143
|
+
hermes_compat: false
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Peers are listed in `peers.yaml` with the environment variables holding their
|
|
147
|
+
inbound and outbound bearer tokens. An ordinary peer task can reach only the
|
|
148
|
+
public news tools. A peer that sends a validated team mission envelope gets
|
|
149
|
+
the tools its `resources` allow (`public:news`, `magnus:fleet`,
|
|
150
|
+
`magnus:node:<id>`, or `tool:<name>` for any registered tool) and must return
|
|
151
|
+
a structured, evidence-checked team result.
|
|
152
|
+
|
|
153
|
+
`hermes_compat: true` additionally serves the authenticated
|
|
154
|
+
`/.well-known/hermes-team-card.json` discovery document and accepts Hermes
|
|
155
|
+
Agent's slash-style JSON-RPC method aliases (`message/send`, `tasks/get`, ...).
|
|
156
|
+
|
|
157
|
+
`ardent a2a discover <peer>` and `ardent a2a call <peer> --prompt TEXT` talk
|
|
158
|
+
to configured peers from the command line.
|
|
159
|
+
|
|
160
|
+
### Magnus Control tools
|
|
161
|
+
|
|
162
|
+
Read-only fleet tools for a [Magnus](https://github.com/ChefTaco/magnus)
|
|
163
|
+
Control API (fleet inventory, readiness, node health, dependency impact,
|
|
164
|
+
anomalies, command status, and more). Enable them with
|
|
165
|
+
`integrations.magnus_control.enabled: true` or `ARDENT_MAGNUS_CONTROL_TOOLS=true`.
|
|
166
|
+
The base URL comes only from `integrations.magnus_control.base_url` (default
|
|
167
|
+
`${ARDENT_MAGNUS_API_URL}`) and the read token from the env var named by
|
|
168
|
+
`token_env` (default `ARDENT_MAGNUS_READ_TOKEN`). Bearer tokens are sent only
|
|
169
|
+
over HTTPS or to loopback.
|
|
170
|
+
|
|
171
|
+
### Scheduled jobs
|
|
172
|
+
|
|
173
|
+
Put job definitions in `jobs/active.json` inside the profile:
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"schema_version": 1, "profile": "assistant", "revision": 1,
|
|
178
|
+
"jobs": [{
|
|
179
|
+
"id": "morning-news", "owner": "ardent", "enabled": true, "handler": "news.collect",
|
|
180
|
+
"schedule": { "cron": "30 6 * * *", "timezone": "Europe/Berlin", "missed_window": "skip", "catch_up_minutes": 0 },
|
|
181
|
+
"input": { "query": "open source AI agents", "max_articles": 3 },
|
|
182
|
+
"delivery": { "kind": "none" },
|
|
183
|
+
"policy": { "max_attempts": 2, "retry_backoff_seconds": 300 }
|
|
184
|
+
}]
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`ardent jobs definitions validate --source /abs/path.json` checks a file
|
|
189
|
+
before you install it; `ardent jobs definitions status` and
|
|
190
|
+
`GET /api/v1/jobs/definitions/status` report the installed revision and recent
|
|
191
|
+
windows. The built-in handler is `news.collect` (requires `research`); plugins
|
|
192
|
+
add more.
|
|
193
|
+
|
|
194
|
+
### Model policy
|
|
195
|
+
|
|
196
|
+
An optional, owner-only `$ARDENT_HOME/model-policy/active.json` selects the
|
|
197
|
+
Codex model and reasoning effort and configures context compaction for all
|
|
198
|
+
profiles under that home. [`model-policy.default.json`](model-policy.default.json)
|
|
199
|
+
is a starting point; compaction is disabled until you enable it.
|
|
200
|
+
|
|
201
|
+
## Plugins
|
|
202
|
+
|
|
203
|
+
A plugin is an ES module whose default export (or named `plugin` export) is an
|
|
204
|
+
`ArdentPlugin` object, or an array of them:
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
import { definePlugin } from '@hivemagnus/ardent';
|
|
208
|
+
import { z } from 'zod';
|
|
209
|
+
|
|
210
|
+
export default definePlugin({
|
|
211
|
+
name: 'weather',
|
|
212
|
+
registerTools(ctx) {
|
|
213
|
+
ctx.tools.register(ctx.defineTool({
|
|
214
|
+
name: 'weather_now', description: 'Current weather for a city.',
|
|
215
|
+
input: z.object({ city: z.string().min(1) }).strict(),
|
|
216
|
+
output: z.object({ summary: z.string() }),
|
|
217
|
+
effect: 'read', contexts: ['direct'], timeoutMs: 10_000,
|
|
218
|
+
handler: async ({ city }, signal) => ({ summary: await lookUp(city, signal) }),
|
|
219
|
+
}));
|
|
220
|
+
},
|
|
221
|
+
routes(app, ctx) { // served under /api/v1/plugins/weather/
|
|
222
|
+
app.get('/health', c => c.json({ ok: true, profile: ctx.config.profile }));
|
|
223
|
+
},
|
|
224
|
+
cliCommands: { // ardent weather-check
|
|
225
|
+
'weather-check': { description: 'Probe the provider', run: async ({ print }) => print({ ok: true }) },
|
|
226
|
+
},
|
|
227
|
+
jobHandlers: ctx => ({ /* 'weather.daily': JobHandler */ }),
|
|
228
|
+
jobOwnership: ctx => async (job, now) => { /* throw to refuse a job window */ },
|
|
229
|
+
peerTool: (tool, task, envelope) => false, // allow a peer to call one of your tools
|
|
230
|
+
});
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Load it from config, as an npm package name (resolved from the profile
|
|
234
|
+
directory first, then from Ardent's own install), an absolute path, or a
|
|
235
|
+
`file://` URL:
|
|
236
|
+
|
|
237
|
+
```yaml
|
|
238
|
+
plugins: ['@example/ardent-weather', /opt/ardent/plugins/local.mjs]
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Embedders that build the runtime themselves can call `registerPlugin()` before
|
|
242
|
+
loading plugins. Plugin tools join the profile's shared tool registry; a tool's
|
|
243
|
+
`contexts` decides whether direct, peer, or scheduled tasks may call it, and a
|
|
244
|
+
peer still needs an explicit mission grant (`tool:<name>`) or `peerTool`.
|
|
245
|
+
Plugin routes sit behind the same bearer-token check as the rest of the
|
|
246
|
+
management API.
|
|
247
|
+
|
|
248
|
+
## Security model
|
|
249
|
+
|
|
250
|
+
- The model never gets a shell, deployment, or credential tool from Ardent
|
|
251
|
+
itself. Retrieved text, memories, and peer messages are treated as data.
|
|
252
|
+
- Every tool declares its effect (`read`, `artifact-write`, `memory-write`,
|
|
253
|
+
`external-write`). A cancelled task whose tool call may have had an effect
|
|
254
|
+
is marked `unknown`, not `cancelled`, and is never retried automatically.
|
|
255
|
+
- Profile state, `.env`, and config are created owner-only (`0600`/`0700`).
|
|
256
|
+
- News URLs are restricted to public HTTP(S) addresses; private and loopback
|
|
257
|
+
ranges are refused.
|
|
258
|
+
|
|
259
|
+
## Development
|
|
260
|
+
|
|
261
|
+
```bash
|
|
262
|
+
npm --workspace @hivemagnus/ardent run typecheck
|
|
263
|
+
npm --workspace @hivemagnus/ardent run lint
|
|
264
|
+
npm --workspace @hivemagnus/ardent test
|
|
265
|
+
npm --workspace @hivemagnus/ardent run build
|
|
266
|
+
npm --workspace @hivemagnus/ardent run openapi:check
|
|
267
|
+
node packages/ardent/scripts/check-package.mjs # packs, installs, and smoke-tests the tarball
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
See [AGENTS.md](AGENTS.md) for contributor guidance.
|
|
271
|
+
|
|
272
|
+
## License
|
|
273
|
+
|
|
274
|
+
Apache-2.0. The vendored A2A protocol definition in `protocol/` carries its own
|
|
275
|
+
license, [`protocol/LICENSE-A2A.txt`](protocol/LICENSE-A2A.txt).
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { type AgentCard, type ListTasksResponse, type SendMessageResult, type StreamResponse, type Task } from '@a2a-js/sdk';
|
|
2
|
+
import { type Client } from '@a2a-js/sdk/client';
|
|
3
|
+
import type { ArdentConfig } from './config.js';
|
|
4
|
+
import type { A2APushInbox } from './a2a-push-inbox.js';
|
|
5
|
+
export declare function fetchHermesTeamCard(card: AgentCard, authorization: string, signal?: AbortSignal): Promise<Record<string, unknown>>;
|
|
6
|
+
export declare class ArdentA2AClient {
|
|
7
|
+
readonly profileDir: string;
|
|
8
|
+
readonly config: ArdentConfig;
|
|
9
|
+
readonly env: NodeJS.ProcessEnv;
|
|
10
|
+
readonly pushInbox?: A2APushInbox | undefined;
|
|
11
|
+
readonly preferredTransports: string[];
|
|
12
|
+
constructor(profileDir: string, config: ArdentConfig, env?: NodeJS.ProcessEnv, pushInbox?: A2APushInbox | undefined, preferredTransports?: string[]);
|
|
13
|
+
open(peerId: string): Promise<{
|
|
14
|
+
card: AgentCard;
|
|
15
|
+
client: Client;
|
|
16
|
+
authorization: string;
|
|
17
|
+
}>;
|
|
18
|
+
teamControl(peerId: string, control: {
|
|
19
|
+
version: '1.0';
|
|
20
|
+
action: string;
|
|
21
|
+
key: string;
|
|
22
|
+
payload: object;
|
|
23
|
+
}): Promise<Record<string, unknown>>;
|
|
24
|
+
send(peerId: string, prompt: string, signal?: AbortSignal, contextId?: string, taskId?: string): Promise<SendMessageResult>;
|
|
25
|
+
getTask(peerId: string, id: string, historyLength?: number): Promise<Task>;
|
|
26
|
+
listTasks(peerId: string, pageSize?: number, pageToken?: string, contextId?: string): Promise<ListTasksResponse>;
|
|
27
|
+
cancelTask(peerId: string, id: string): Promise<Task>;
|
|
28
|
+
extendedCard(peerId: string): Promise<AgentCard>;
|
|
29
|
+
subscribe(peerId: string, id: string, signal?: AbortSignal): AsyncGenerator<StreamResponse>;
|
|
30
|
+
sendStreaming(peerId: string, prompt: string, signal?: AbortSignal): AsyncGenerator<StreamResponse>;
|
|
31
|
+
sendWithReceipt(peerId: string, prompt: string, signal?: AbortSignal, contextId?: string, taskId?: string): Promise<{
|
|
32
|
+
result: SendMessageResult;
|
|
33
|
+
outboundId?: string;
|
|
34
|
+
}>;
|
|
35
|
+
}
|