@hivemagnus/ardent-studio 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/NOTICE +12 -0
- package/README.md +133 -2
- package/dist/agents/config-edit.d.ts +20 -0
- package/dist/agents/config-edit.js +75 -0
- package/dist/agents/directory.d.ts +27 -0
- package/dist/agents/directory.js +97 -0
- package/dist/agents/operations.d.ts +47 -0
- package/dist/agents/operations.js +93 -0
- package/dist/auth/links.d.ts +27 -0
- package/dist/auth/links.js +46 -0
- package/dist/auth/oathweave.d.ts +46 -0
- package/dist/auth/oathweave.js +123 -0
- package/dist/blobs/store.d.ts +45 -0
- package/dist/blobs/store.js +159 -0
- package/dist/clients/chattermost.d.ts +16 -0
- package/dist/clients/chattermost.js +36 -0
- package/dist/clients/hivemem.d.ts +85 -0
- package/dist/clients/hivemem.js +89 -0
- package/dist/clients/magnus.d.ts +851 -0
- package/dist/clients/magnus.js +541 -0
- package/dist/clients/service-token.d.ts +24 -0
- package/dist/clients/service-token.js +87 -0
- package/dist/clients/sse.d.ts +8 -0
- package/dist/clients/sse.js +42 -0
- package/dist/conductor/activity.d.ts +38 -0
- package/dist/conductor/activity.js +101 -0
- package/dist/conductor/addressing.d.ts +24 -0
- package/dist/conductor/addressing.js +42 -0
- package/dist/conductor/conductor.d.ts +225 -0
- package/dist/conductor/conductor.js +939 -0
- package/dist/conductor/follower.d.ts +48 -0
- package/dist/conductor/follower.js +154 -0
- package/dist/conductor/live.d.ts +23 -0
- package/dist/conductor/live.js +32 -0
- package/dist/conductor/prompting.d.ts +74 -0
- package/dist/conductor/prompting.js +177 -0
- package/dist/config.d.ts +52 -0
- package/dist/config.js +163 -0
- package/dist/db/database.d.ts +12 -0
- package/dist/db/database.js +62 -0
- package/dist/db/json.d.ts +8 -0
- package/dist/db/json.js +13 -0
- package/dist/db/migrations.d.ts +6 -0
- package/dist/db/migrations.js +571 -0
- package/dist/db/repos/agents.d.ts +86 -0
- package/dist/db/repos/agents.js +92 -0
- package/dist/db/repos/audit.d.ts +37 -0
- package/dist/db/repos/audit.js +20 -0
- package/dist/db/repos/events.d.ts +29 -0
- package/dist/db/repos/events.js +55 -0
- package/dist/db/repos/files.d.ts +41 -0
- package/dist/db/repos/files.js +72 -0
- package/dist/db/repos/idempotency.d.ts +27 -0
- package/dist/db/repos/idempotency.js +46 -0
- package/dist/db/repos/links.d.ts +47 -0
- package/dist/db/repos/links.js +99 -0
- package/dist/db/repos/projects.d.ts +44 -0
- package/dist/db/repos/projects.js +107 -0
- package/dist/db/repos/proposals.d.ts +46 -0
- package/dist/db/repos/proposals.js +65 -0
- package/dist/db/repos/review.d.ts +191 -0
- package/dist/db/repos/review.js +195 -0
- package/dist/db/repos/room.d.ts +163 -0
- package/dist/db/repos/room.js +151 -0
- package/dist/db/repos/sessions.d.ts +36 -0
- package/dist/db/repos/sessions.js +30 -0
- package/dist/db/repos/summaries.d.ts +22 -0
- package/dist/db/repos/summaries.js +105 -0
- package/dist/db/repos/tasks.d.ts +103 -0
- package/dist/db/repos/tasks.js +112 -0
- package/dist/db/repos/team.d.ts +49 -0
- package/dist/db/repos/team.js +95 -0
- package/dist/db/repos/templates.d.ts +55 -0
- package/dist/db/repos/templates.js +120 -0
- package/dist/db/store.d.ts +57 -0
- package/dist/db/store.js +108 -0
- package/dist/events/bus.d.ts +21 -0
- package/dist/events/bus.js +31 -0
- package/dist/events/types.d.ts +3 -0
- package/dist/events/types.js +1 -0
- package/dist/ids.d.ts +28 -0
- package/dist/ids.js +81 -0
- package/dist/index.d.ts +18 -0
- package/dist/index.js +17 -0
- package/dist/knowledge/extract.d.ts +17 -0
- package/dist/knowledge/extract.js +82 -0
- package/dist/knowledge/sync.d.ts +40 -0
- package/dist/knowledge/sync.js +172 -0
- package/dist/logger.d.ts +5 -0
- package/dist/logger.js +11 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +42 -0
- package/dist/review/anchors.d.ts +16 -0
- package/dist/review/anchors.js +67 -0
- package/dist/review/context.d.ts +4 -0
- package/dist/review/context.js +29 -0
- package/dist/review/docx.d.ts +29 -0
- package/dist/review/docx.js +21 -0
- package/dist/review/export.d.ts +16 -0
- package/dist/review/export.js +84 -0
- package/dist/review/importer.d.ts +68 -0
- package/dist/review/importer.js +215 -0
- package/dist/review/index.d.ts +13 -0
- package/dist/review/index.js +7 -0
- package/dist/server/app.d.ts +5 -0
- package/dist/server/app.js +44 -0
- package/dist/server/deps.d.ts +43 -0
- package/dist/server/deps.js +17 -0
- package/dist/server/env.d.ts +6 -0
- package/dist/server/env.js +1 -0
- package/dist/server/errors.d.ts +12 -0
- package/dist/server/errors.js +25 -0
- package/dist/server/routes/agent-studio.d.ts +5 -0
- package/dist/server/routes/agent-studio.js +441 -0
- package/dist/server/routes/agents.d.ts +3 -0
- package/dist/server/routes/agents.js +4 -0
- package/dist/server/routes/files.d.ts +3 -0
- package/dist/server/routes/files.js +88 -0
- package/dist/server/routes/health.d.ts +3 -0
- package/dist/server/routes/health.js +31 -0
- package/dist/server/routes/links.d.ts +3 -0
- package/dist/server/routes/links.js +79 -0
- package/dist/server/routes/projects.d.ts +3 -0
- package/dist/server/routes/projects.js +119 -0
- package/dist/server/routes/review.d.ts +3 -0
- package/dist/server/routes/review.js +198 -0
- package/dist/server/routes/room.d.ts +9 -0
- package/dist/server/routes/room.js +224 -0
- package/dist/server/routes/stream.d.ts +4 -0
- package/dist/server/routes/stream.js +104 -0
- package/dist/server/routes/team.d.ts +3 -0
- package/dist/server/routes/team.js +183 -0
- package/dist/server/routes/templates.d.ts +11 -0
- package/dist/server/routes/templates.js +103 -0
- package/dist/server/routes/work.d.ts +3 -0
- package/dist/server/routes/work.js +139 -0
- package/dist/server/routing.d.ts +31 -0
- package/dist/server/routing.js +132 -0
- package/dist/service.d.ts +34 -0
- package/dist/service.js +93 -0
- package/dist/shared/browser.d.ts +5824 -0
- package/dist/shared/browser.js +1318 -0
- package/dist/team/proposals.d.ts +129 -0
- package/dist/team/proposals.js +349 -0
- package/dist/team/service.d.ts +12 -0
- package/dist/team/service.js +13 -0
- package/dist/team/validation.d.ts +37 -0
- package/dist/team/validation.js +157 -0
- package/dist/templates/secrets.d.ts +2 -0
- package/dist/templates/secrets.js +23 -0
- package/dist/templates/seeds.d.ts +34 -0
- package/dist/templates/seeds.js +277 -0
- package/dist/url.d.ts +2 -0
- package/dist/url.js +7 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +11 -0
- package/docs/openapi-browser.json +12658 -0
- package/package.json +91 -4
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/NOTICE
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
Ardent Project Studio (ArdentStudio)
|
|
2
|
+
Copyright 2026 ChefTaco and contributors
|
|
3
|
+
|
|
4
|
+
This product includes software developed by ChefTaco and contributors
|
|
5
|
+
(https://github.com/ChefTaco/ArdentStudio).
|
|
6
|
+
|
|
7
|
+
The Oathweave resource-token verification follows the pattern of the Magnus and
|
|
8
|
+
HiveMem products (https://github.com/ChefTaco/magnus, https://github.com/ChefTaco/HiveMem),
|
|
9
|
+
licensed under the Apache License 2.0.
|
|
10
|
+
|
|
11
|
+
PDF text extraction uses pdf.js (https://github.com/mozilla/pdf.js),
|
|
12
|
+
licensed under the Apache License 2.0.
|
package/README.md
CHANGED
|
@@ -1,3 +1,134 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Ardent Project Studio (ArdentStudio)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
ArdentStudio is the backend of **Ardent Project Studio**, the Hive:Magnus workspace where an
|
|
4
|
+
operator gives several [Ardent](https://github.com/ChefTaco/Ardent) agents a shared project, puts
|
|
5
|
+
them in a team, watches them work together and reviews what they deliver. The UI is the Studio
|
|
6
|
+
module of HiveXUI (`/studio`); this service owns the records behind it.
|
|
7
|
+
|
|
8
|
+
A project has three areas:
|
|
9
|
+
|
|
10
|
+
1. **Team Assignment**: roles, relationships and agent bindings, as draft and published revisions,
|
|
11
|
+
started from versioned templates.
|
|
12
|
+
2. **Team Conversation Room**: the canonical transcript, live agent replies, tasks, clarifications,
|
|
13
|
+
discussions and decisions, driven by the conductor ([docs/CONDUCTOR.md](docs/CONDUCTOR.md)).
|
|
14
|
+
3. **Agent Studio**: agent tuning, previews, development records and **Deliverable Review**
|
|
15
|
+
(verified deliverable revisions, anchored comments, revision requests, decisions and exports).
|
|
16
|
+
|
|
17
|
+
Version 0.1 covers projects, reference files with HiveMem knowledge sync, templates, team
|
|
18
|
+
assignment, agents through Magnus (Agent Studio drafts, streaming previews, apply, development
|
|
19
|
+
records and New Agent), the conversation room with its conductor, Deliverable Review and the live
|
|
20
|
+
project event stream.
|
|
21
|
+
|
|
22
|
+
## Requirements
|
|
23
|
+
|
|
24
|
+
| Dependency | Required | Why |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| [Magnus](https://github.com/ChefTaco/magnus) with **at least one Ardent agent** | Yes | All agent access goes through Magnus. Studio never talks to nodes or Ardent directly. |
|
|
27
|
+
| [HiveMem](https://github.com/ChefTaco/HiveMem) | Yes | Each project has a HiveMem workspace; reference files are synced into it as knowledge. |
|
|
28
|
+
| [Oathweave](https://github.com/ChefTaco/Oathweave) | Yes | Sign-in for people (audience `ardentstudio`) and ArdentStudio's own service identity. |
|
|
29
|
+
| ChatterMost | No | Optional one-way announcements through an incoming webhook. |
|
|
30
|
+
|
|
31
|
+
Node.js 24.22.1+ or 26.13.0+.
|
|
32
|
+
|
|
33
|
+
## Architecture
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
HiveXUI /studio/* ── user token (audience ardentstudio) ──▶ ArdentStudio /api/ardentstudio/v1/*
|
|
37
|
+
SQLite (WAL) + content-addressed blobs
|
|
38
|
+
project event feed (SSE)
|
|
39
|
+
│ service identity (client_credentials)
|
|
40
|
+
┌────────────────────────────┴───────────────────────────┐
|
|
41
|
+
▼ audience magnus, x-acting-subject ▼ audience hivemem
|
|
42
|
+
Magnus control API /api/v1/ardent/* HiveMem /v1/workspaces,
|
|
43
|
+
── node agent ──▶ Ardent profile API /v1/knowledge/sources/sync
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
- **ArdentStudio owns** projects, templates, team revisions, the transcript, decisions, the Studio
|
|
47
|
+
task mirror, deliverables, review records, exports, drafts, presentation and the event feed.
|
|
48
|
+
- **Magnus owns** the fleet, profile lifecycle and all agent access. ArdentStudio calls it with its
|
|
49
|
+
own Oathweave service identity and forwards the acting person's subject in `x-acting-subject`.
|
|
50
|
+
- **Ardent owns** execution, sessions, journals, live reply text, artifacts and identity history.
|
|
51
|
+
- **HiveMem owns** project knowledge (one workspace per project) and agent memory.
|
|
52
|
+
|
|
53
|
+
Studio uses Magnus's Ardent bridge for service identities (sessions, task streams, missions,
|
|
54
|
+
pause and resume, New Agent). An agent whose Magnus node agent reports a lower Studio level still
|
|
55
|
+
works through plain task submission; see [docs/CONDUCTOR.md](docs/CONDUCTOR.md).
|
|
56
|
+
|
|
57
|
+
## Quick start
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npm ci
|
|
61
|
+
npm run build
|
|
62
|
+
cp .env.example .env # fill in real values privately; never commit them
|
|
63
|
+
set -a; . ./.env; set +a
|
|
64
|
+
node dist/main.js serve
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
`node dist/main.js env` lists every variable. The service refuses to start, naming each problem,
|
|
68
|
+
when a required setting is missing or unsafe.
|
|
69
|
+
|
|
70
|
+
## Configuration
|
|
71
|
+
|
|
72
|
+
| Variable | Required | Default | Description |
|
|
73
|
+
|---|---|---|---|
|
|
74
|
+
| `ARDENT_STUDIO_DATA` | yes | | Absolute data directory (`studio.sqlite`, `blobs/`). The image uses `/data`. |
|
|
75
|
+
| `ARDENT_STUDIO_HOST` | | `127.0.0.1` | Listen address (`0.0.0.0` in the image). |
|
|
76
|
+
| `ARDENT_STUDIO_PORT` | | `8097` | Listen port. |
|
|
77
|
+
| `ARDENT_STUDIO_MAX_BLOB_BYTES` | | `67108864` | Largest stored file (64 MiB). |
|
|
78
|
+
| `ARDENT_STUDIO_EVENT_RETENTION_DAYS` | | `30` | Event replay window; older cursors get `reset`. |
|
|
79
|
+
| `ARDENT_STUDIO_LOG_LEVEL` | | `info` | `debug`, `info`, `warn` or `error`. |
|
|
80
|
+
| `OATHWEAVE_ISSUER` | yes | | Oathweave browser issuer (HTTPS). |
|
|
81
|
+
| `OATHWEAVE_JWKS_URL` | yes | | Oathweave JWKS (HTTPS). |
|
|
82
|
+
| `OATHWEAVE_USERINFO_URL` | yes | | Oathweave userinfo (HTTPS), for session revocation. |
|
|
83
|
+
| `ARDENT_STUDIO_OATHWEAVE_IDENTITIES_JSON` | yes | | Explicit account links; see [docs/OATHWEAVE.md](docs/OATHWEAVE.md). |
|
|
84
|
+
| `ARDENT_STUDIO_OATHWEAVE_TOKEN_URL` | yes | | Oathweave token endpoint for `client_credentials`. |
|
|
85
|
+
| `ARDENT_STUDIO_MAGNUS_URL` | yes | | Magnus control API origin. |
|
|
86
|
+
| `ARDENT_STUDIO_MAGNUS_CLIENT_ID` | yes | | Machine client for the audience `magnus`. |
|
|
87
|
+
| `ARDENT_STUDIO_MAGNUS_CLIENT_SECRET` | yes (secret) | | Its secret. |
|
|
88
|
+
| `ARDENT_STUDIO_MAGNUS_SCOPE` | | `magnus:ardent` | Token scope. Oathweave grants nothing without one. |
|
|
89
|
+
| `ARDENT_STUDIO_HIVEMEM_URL` | yes | | HiveMem origin. |
|
|
90
|
+
| `ARDENT_STUDIO_HIVEMEM_CLIENT_ID` | yes | | Machine client for the audience `hivemem`. |
|
|
91
|
+
| `ARDENT_STUDIO_HIVEMEM_CLIENT_SECRET` | yes (secret) | | Its secret. |
|
|
92
|
+
| `ARDENT_STUDIO_HIVEMEM_SCOPE` | | `hivemem:workspaces:write hivemem:memories:write` | Token scope. |
|
|
93
|
+
| `ARDENT_STUDIO_CHATTERMOST_WEBHOOK_URL` | (secret) | | Optional incoming-webhook URL for announcements. |
|
|
94
|
+
| `ARDENT_STUDIO_ALLOW_PLAINTEXT_SERVICES` | | `false` | Allow `http://` service URLs off loopback (isolated container networks only). |
|
|
95
|
+
|
|
96
|
+
Service URLs must use HTTPS except on loopback. For a private CA, set `NODE_EXTRA_CA_CERTS`.
|
|
97
|
+
|
|
98
|
+
## API
|
|
99
|
+
|
|
100
|
+
All routes live under `/api/ardentstudio/v1` and need an Oathweave bearer token with the listed
|
|
101
|
+
permission, except the health routes. Every mutation takes `x-idempotency-key`. See
|
|
102
|
+
[docs/API.md](docs/API.md); the machine-readable contract is
|
|
103
|
+
[`docs/openapi-browser.json`](docs/openapi-browser.json), generated from the zod contract in
|
|
104
|
+
[`src/shared/browser.ts`](src/shared/browser.ts) (also exported as
|
|
105
|
+
`@hivemagnus/ardent-studio/browser`).
|
|
106
|
+
|
|
107
|
+
## Container image
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
docker build -t ardent-studio .
|
|
111
|
+
docker run --env-file ./studio.env -v ardentstudio-data:/data -p 127.0.0.1:8097:8097 ardent-studio
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
The image runs as `node`, ships no package manager and keeps all state in the `/data` volume.
|
|
115
|
+
Back up that volume; see [docs/OPERATIONS.md](docs/OPERATIONS.md).
|
|
116
|
+
|
|
117
|
+
Each release is published to npm as `@hivemagnus/ardent-studio` (with provenance) and as the
|
|
118
|
+
image `ghcr.io/cheftaco/ardent-studio:<version>` for `linux/amd64` and `linux/arm64`. There is no
|
|
119
|
+
`latest` tag; the [GitHub release](https://github.com/ChefTaco/ArdentStudio/releases) records
|
|
120
|
+
the image digest. In the Hive suite, `hive.sh` installs ArdentStudio as an optional product and
|
|
121
|
+
pins the image by digest from a signed release manifest.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run hooks:install
|
|
127
|
+
npm run verify # privacy and secret scans, typecheck, lint, tests, build, contract check, package check
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
See [AGENTS.md](AGENTS.md) and [CONTRIBUTING.md](CONTRIBUTING.md).
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE).
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ArdentServiceConfigPath } from '../clients/magnus.js';
|
|
2
|
+
export declare class ConfigEditError extends Error {
|
|
3
|
+
readonly code: 'CONFIG_UNREADABLE' | 'CONFIG_PATH_FORBIDDEN';
|
|
4
|
+
name: string;
|
|
5
|
+
constructor(message: string, code: 'CONFIG_UNREADABLE' | 'CONFIG_PATH_FORBIDDEN');
|
|
6
|
+
}
|
|
7
|
+
/** The value at a dotted path of the configuration, or undefined. */
|
|
8
|
+
export declare function configValue(text: string, path: ArdentServiceConfigPath): unknown;
|
|
9
|
+
/** Set allowlisted values, keeping the rest of the document byte for byte where YAML allows. */
|
|
10
|
+
export declare function editConfig(text: string, changes: Partial<Record<ArdentServiceConfigPath, unknown>>): string;
|
|
11
|
+
/** Leaf paths whose values differ between two configurations. An array is one value. */
|
|
12
|
+
export declare function changedConfigPaths(before: string, after: string): string[];
|
|
13
|
+
/**
|
|
14
|
+
* The skills the saved configuration enables (skills.enabled). Ardent's skill list reports the
|
|
15
|
+
* running profile, which loads its configuration at start, so a skill enabled since then lists as
|
|
16
|
+
* off until the profile restarts; this is the state a skill change is made against.
|
|
17
|
+
*/
|
|
18
|
+
export declare function configuredSkills(text: string): string[];
|
|
19
|
+
/** The model setting for the configured backend: providers.codex.model on codex, else providers.llamacpp.model. */
|
|
20
|
+
export declare function modelPath(text: string): ArdentServiceConfigPath;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Edits to an agent's config.yaml that Studio may send through Magnus config-save. The document is
|
|
2
|
+
// edited in place with the yaml library, so comments, order, formatting and every other value stay
|
|
3
|
+
// exactly as they were; only ARDENT_SERVICE_CONFIG_PATHS may change, and that is checked before
|
|
4
|
+
// anything is sent.
|
|
5
|
+
import { isMap, isSeq, parse, parseDocument } from 'yaml';
|
|
6
|
+
import { ARDENT_SERVICE_CONFIG_PATHS } from '../clients/magnus.js';
|
|
7
|
+
export class ConfigEditError extends Error {
|
|
8
|
+
code;
|
|
9
|
+
name = 'ConfigEditError';
|
|
10
|
+
constructor(message, code) {
|
|
11
|
+
super(message);
|
|
12
|
+
this.code = code;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const ALLOWED = new Set(ARDENT_SERVICE_CONFIG_PATHS);
|
|
16
|
+
/** The value at a dotted path of the configuration, or undefined. */
|
|
17
|
+
export function configValue(text, path) {
|
|
18
|
+
const document = parseDocument(text);
|
|
19
|
+
if (document.errors.length)
|
|
20
|
+
throw new ConfigEditError(`The agent's configuration is not valid YAML: ${document.errors[0].message}`, 'CONFIG_UNREADABLE');
|
|
21
|
+
return document.getIn(path.split('.'));
|
|
22
|
+
}
|
|
23
|
+
/** Set allowlisted values, keeping the rest of the document byte for byte where YAML allows. */
|
|
24
|
+
export function editConfig(text, changes) {
|
|
25
|
+
const document = parseDocument(text);
|
|
26
|
+
if (document.errors.length)
|
|
27
|
+
throw new ConfigEditError(`The agent's configuration is not valid YAML: ${document.errors[0].message}`, 'CONFIG_UNREADABLE');
|
|
28
|
+
if (!isMap(document.contents))
|
|
29
|
+
throw new ConfigEditError('The agent\'s configuration is not a YAML mapping', 'CONFIG_UNREADABLE');
|
|
30
|
+
for (const [path, value] of Object.entries(changes)) {
|
|
31
|
+
if (!ALLOWED.has(path))
|
|
32
|
+
throw new ConfigEditError(`Studio may not change ${path}`, 'CONFIG_PATH_FORBIDDEN');
|
|
33
|
+
document.setIn(path.split('.'), value);
|
|
34
|
+
}
|
|
35
|
+
const next = document.toString({ flowCollectionPadding: false });
|
|
36
|
+
const outside = changedConfigPaths(text, next).filter(path => !ALLOWED.has(path));
|
|
37
|
+
if (outside.length)
|
|
38
|
+
throw new ConfigEditError(`The edit would change ${outside.join(', ')}`, 'CONFIG_PATH_FORBIDDEN');
|
|
39
|
+
return next;
|
|
40
|
+
}
|
|
41
|
+
const plainObject = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
|
|
42
|
+
/** Leaf paths whose values differ between two configurations. An array is one value. */
|
|
43
|
+
export function changedConfigPaths(before, after) {
|
|
44
|
+
const changed = [];
|
|
45
|
+
const walk = (left, right, path) => {
|
|
46
|
+
if ((plainObject(left) || left === undefined) && (plainObject(right) || right === undefined) && (plainObject(left) || plainObject(right))) {
|
|
47
|
+
const keys = new Set([...Object.keys(left ?? {}), ...Object.keys(right ?? {})]);
|
|
48
|
+
for (const key of keys)
|
|
49
|
+
walk(left?.[key], right?.[key], [...path, key]);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
if (JSON.stringify(left) !== JSON.stringify(right))
|
|
53
|
+
changed.push(path.join('.'));
|
|
54
|
+
};
|
|
55
|
+
walk(parse(before), parse(after), []);
|
|
56
|
+
return changed;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The skills the saved configuration enables (skills.enabled). Ardent's skill list reports the
|
|
60
|
+
* running profile, which loads its configuration at start, so a skill enabled since then lists as
|
|
61
|
+
* off until the profile restarts; this is the state a skill change is made against.
|
|
62
|
+
*/
|
|
63
|
+
export function configuredSkills(text) {
|
|
64
|
+
const value = configValue(text, 'skills.enabled');
|
|
65
|
+
if (value === undefined || value === null)
|
|
66
|
+
return [];
|
|
67
|
+
const list = isSeq(value) ? value.toJSON() : value;
|
|
68
|
+
if (!Array.isArray(list) || !list.every(item => typeof item === 'string'))
|
|
69
|
+
throw new ConfigEditError('The agent\'s configuration has a skills.enabled that is not a list of names', 'CONFIG_UNREADABLE');
|
|
70
|
+
return list;
|
|
71
|
+
}
|
|
72
|
+
/** The model setting for the configured backend: providers.codex.model on codex, else providers.llamacpp.model. */
|
|
73
|
+
export function modelPath(text) {
|
|
74
|
+
return configValue(text, 'execution.backend') === 'codex' ? 'providers.codex.model' : 'providers.llamacpp.model';
|
|
75
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import { type CallContext, type MagnusArdentProfile, type MagnusClient } from '../clients/magnus.js';
|
|
3
|
+
import type { Store } from '../db/store.js';
|
|
4
|
+
import type { agentSchema, listAgentsResponseSchema } from '../shared/browser.js';
|
|
5
|
+
import type { AgentFacts } from '../team/validation.js';
|
|
6
|
+
export type StudioAgent = z.infer<typeof agentSchema>;
|
|
7
|
+
export type AgentList = z.infer<typeof listAgentsResponseSchema>;
|
|
8
|
+
export type MagnusAgentApi = Pick<MagnusClient, 'listProfiles' | 'memoryStatus' | 'skills'>;
|
|
9
|
+
export declare class AgentDirectory {
|
|
10
|
+
private readonly magnus;
|
|
11
|
+
private readonly store;
|
|
12
|
+
private cache;
|
|
13
|
+
private readonly now;
|
|
14
|
+
private readonly cacheMs;
|
|
15
|
+
constructor(magnus: MagnusAgentApi, store: Store, options?: {
|
|
16
|
+
now?: () => number;
|
|
17
|
+
cacheMs?: number;
|
|
18
|
+
});
|
|
19
|
+
/** Forget the cached profiles, so an agent that New Agent just created is listed at once. */
|
|
20
|
+
invalidate(): void;
|
|
21
|
+
/** Magnus profiles, cached briefly so one page load does not ask Magnus repeatedly. */
|
|
22
|
+
profiles(context?: CallContext): Promise<MagnusArdentProfile[]>;
|
|
23
|
+
list(context?: CallContext): Promise<AgentList>;
|
|
24
|
+
/** Facts for team validation. Undefined when Magnus cannot list profiles at all. */
|
|
25
|
+
facts(refs: readonly string[], context?: CallContext): Promise<Map<string, AgentFacts> | undefined>;
|
|
26
|
+
}
|
|
27
|
+
export declare function isAvailable(profile: MagnusArdentProfile): boolean;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { agentRef } from '../clients/magnus.js';
|
|
2
|
+
const PROFILE_CACHE_MS = 10_000;
|
|
3
|
+
const FACT_TIMEOUT_MS = 4_000;
|
|
4
|
+
function withTimeout(promise, ms) {
|
|
5
|
+
return Promise.race([promise, new Promise((_, reject) => setTimeout(() => reject(new Error('timeout')), ms).unref())]);
|
|
6
|
+
}
|
|
7
|
+
export class AgentDirectory {
|
|
8
|
+
magnus;
|
|
9
|
+
store;
|
|
10
|
+
cache;
|
|
11
|
+
now;
|
|
12
|
+
cacheMs;
|
|
13
|
+
constructor(magnus, store, options = {}) {
|
|
14
|
+
this.magnus = magnus;
|
|
15
|
+
this.store = store;
|
|
16
|
+
this.now = options.now ?? Date.now;
|
|
17
|
+
this.cacheMs = options.cacheMs ?? PROFILE_CACHE_MS;
|
|
18
|
+
}
|
|
19
|
+
/** Forget the cached profiles, so an agent that New Agent just created is listed at once. */
|
|
20
|
+
invalidate() { this.cache = undefined; }
|
|
21
|
+
/** Magnus profiles, cached briefly so one page load does not ask Magnus repeatedly. */
|
|
22
|
+
async profiles(context = {}) {
|
|
23
|
+
if (this.cache && this.now() - this.cache.at < this.cacheMs)
|
|
24
|
+
return this.cache.profiles;
|
|
25
|
+
const profiles = await this.magnus.listProfiles(context);
|
|
26
|
+
this.cache = { at: this.now(), profiles };
|
|
27
|
+
return profiles;
|
|
28
|
+
}
|
|
29
|
+
async list(context = {}) {
|
|
30
|
+
let profiles;
|
|
31
|
+
try {
|
|
32
|
+
profiles = await this.profiles(context);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
return { agents: [], available_count: 0, magnus: { state: 'unavailable', error: error instanceof Error ? error.message.slice(0, 300) : 'Magnus unavailable' } };
|
|
36
|
+
}
|
|
37
|
+
const presentations = new Map(this.store.agents.presentations().map(item => [item.agent_ref, item]));
|
|
38
|
+
const bindings = new Map(this.store.team.bindings().map(item => [item.agent_ref, item]));
|
|
39
|
+
const roles = this.store.team.rolesForAgents();
|
|
40
|
+
const agents = profiles.map((profile) => {
|
|
41
|
+
const ref = agentRef(profile.nodeId, profile.id);
|
|
42
|
+
const presentation = presentations.get(ref);
|
|
43
|
+
const binding = bindings.get(ref);
|
|
44
|
+
return {
|
|
45
|
+
agent_ref: ref,
|
|
46
|
+
node_id: profile.nodeId,
|
|
47
|
+
node_name: profile.nodeName,
|
|
48
|
+
profile: profile.id,
|
|
49
|
+
backend: profile.backend,
|
|
50
|
+
running: profile.running,
|
|
51
|
+
reachable: profile.reachable,
|
|
52
|
+
available: isAvailable(profile),
|
|
53
|
+
installation_version: profile.installationVersion,
|
|
54
|
+
error: profile.error,
|
|
55
|
+
display_name: presentation?.display_name ?? binding?.display_name ?? profile.id,
|
|
56
|
+
portrait: presentation?.portrait ?? null,
|
|
57
|
+
binding_id: binding?.id ?? null,
|
|
58
|
+
roles: roles.filter(role => role.agent_ref === ref).map(({ agent_ref: _ref, ...role }) => role),
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
return { agents, available_count: agents.filter(agent => agent.available).length, magnus: { state: 'ok', error: null } };
|
|
62
|
+
}
|
|
63
|
+
/** Facts for team validation. Undefined when Magnus cannot list profiles at all. */
|
|
64
|
+
async facts(refs, context = {}) {
|
|
65
|
+
if (!refs.length)
|
|
66
|
+
return new Map();
|
|
67
|
+
let profiles;
|
|
68
|
+
try {
|
|
69
|
+
profiles = await this.profiles(context);
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return undefined;
|
|
73
|
+
}
|
|
74
|
+
const byRef = new Map(profiles.map(profile => [agentRef(profile.nodeId, profile.id), profile]));
|
|
75
|
+
const entries = await Promise.all([...new Set(refs)].map(async (ref) => {
|
|
76
|
+
const profile = byRef.get(ref);
|
|
77
|
+
if (!profile)
|
|
78
|
+
return [ref, { available: false, hivemem: 'unknown', skillsEnabled: null }];
|
|
79
|
+
const available = isAvailable(profile);
|
|
80
|
+
if (!available)
|
|
81
|
+
return [ref, { available, hivemem: 'unknown', skillsEnabled: null }];
|
|
82
|
+
const [memory, skills] = await Promise.allSettled([
|
|
83
|
+
withTimeout(this.magnus.memoryStatus(ref, context), FACT_TIMEOUT_MS),
|
|
84
|
+
withTimeout(this.magnus.skills(ref, context), FACT_TIMEOUT_MS),
|
|
85
|
+
]);
|
|
86
|
+
return [ref, {
|
|
87
|
+
available,
|
|
88
|
+
hivemem: memory.status === 'fulfilled' ? (memory.value.status === 'ready' ? 'ok' : 'missing') : 'unknown',
|
|
89
|
+
skillsEnabled: skills.status === 'fulfilled' ? skills.value.filter(skill => skill.enabled).map(skill => skill.name) : null,
|
|
90
|
+
}];
|
|
91
|
+
}));
|
|
92
|
+
return new Map(entries);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export function isAvailable(profile) {
|
|
96
|
+
return profile.reachable && profile.running && !profile.error;
|
|
97
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type MagnusAgentOperation, type MagnusClient } from '../clients/magnus.js';
|
|
2
|
+
import type { AgentOperationRecord } from '../db/repos/agents.js';
|
|
3
|
+
import type { Store } from '../db/store.js';
|
|
4
|
+
import type { Logger } from '../logger.js';
|
|
5
|
+
export type OperationMagnus = Pick<MagnusClient, 'agentOperation' | 'streamAgentOperation'>;
|
|
6
|
+
/** An operation as the browser sees it. */
|
|
7
|
+
export declare function operationView(record: AgentOperationRecord, operation: MagnusAgentOperation | undefined): {
|
|
8
|
+
id: string;
|
|
9
|
+
agent_ref: string;
|
|
10
|
+
project_id: string | null;
|
|
11
|
+
role_key: string | null;
|
|
12
|
+
kind: "hivemem" | "deploy";
|
|
13
|
+
status: "failed" | "running" | "succeeded";
|
|
14
|
+
steps: {
|
|
15
|
+
name: string;
|
|
16
|
+
status: "pending" | "failed" | "running" | "succeeded" | "skipped";
|
|
17
|
+
started_at: string | null;
|
|
18
|
+
finished_at: string | null;
|
|
19
|
+
receipt: Record<string, unknown> | null;
|
|
20
|
+
error: string | null;
|
|
21
|
+
}[];
|
|
22
|
+
error: string | null;
|
|
23
|
+
attempts: number;
|
|
24
|
+
created_by: string;
|
|
25
|
+
created_at: string;
|
|
26
|
+
updated_at: string;
|
|
27
|
+
completed_at: string | null;
|
|
28
|
+
};
|
|
29
|
+
export declare class OperationRelay {
|
|
30
|
+
private readonly store;
|
|
31
|
+
private readonly magnus;
|
|
32
|
+
private readonly logger;
|
|
33
|
+
private readonly options;
|
|
34
|
+
private readonly running;
|
|
35
|
+
private stopped;
|
|
36
|
+
constructor(store: Store, magnus: OperationMagnus, logger: Logger, options?: {
|
|
37
|
+
pollMs?: number;
|
|
38
|
+
maxPolls?: number;
|
|
39
|
+
onFinished?: (operation: MagnusAgentOperation) => void;
|
|
40
|
+
});
|
|
41
|
+
start(): void;
|
|
42
|
+
stop(): Promise<void>;
|
|
43
|
+
follow(id: string): void;
|
|
44
|
+
/** Store and publish Magnus's view of an operation. True once it has finished. */
|
|
45
|
+
apply(id: string, operation: MagnusAgentOperation): boolean;
|
|
46
|
+
private run;
|
|
47
|
+
}
|