@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.
Files changed (159) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +12 -0
  3. package/README.md +133 -2
  4. package/dist/agents/config-edit.d.ts +20 -0
  5. package/dist/agents/config-edit.js +75 -0
  6. package/dist/agents/directory.d.ts +27 -0
  7. package/dist/agents/directory.js +97 -0
  8. package/dist/agents/operations.d.ts +47 -0
  9. package/dist/agents/operations.js +93 -0
  10. package/dist/auth/links.d.ts +27 -0
  11. package/dist/auth/links.js +46 -0
  12. package/dist/auth/oathweave.d.ts +46 -0
  13. package/dist/auth/oathweave.js +123 -0
  14. package/dist/blobs/store.d.ts +45 -0
  15. package/dist/blobs/store.js +159 -0
  16. package/dist/clients/chattermost.d.ts +16 -0
  17. package/dist/clients/chattermost.js +36 -0
  18. package/dist/clients/hivemem.d.ts +85 -0
  19. package/dist/clients/hivemem.js +89 -0
  20. package/dist/clients/magnus.d.ts +851 -0
  21. package/dist/clients/magnus.js +541 -0
  22. package/dist/clients/service-token.d.ts +24 -0
  23. package/dist/clients/service-token.js +87 -0
  24. package/dist/clients/sse.d.ts +8 -0
  25. package/dist/clients/sse.js +42 -0
  26. package/dist/conductor/activity.d.ts +38 -0
  27. package/dist/conductor/activity.js +101 -0
  28. package/dist/conductor/addressing.d.ts +24 -0
  29. package/dist/conductor/addressing.js +42 -0
  30. package/dist/conductor/conductor.d.ts +225 -0
  31. package/dist/conductor/conductor.js +939 -0
  32. package/dist/conductor/follower.d.ts +48 -0
  33. package/dist/conductor/follower.js +154 -0
  34. package/dist/conductor/live.d.ts +23 -0
  35. package/dist/conductor/live.js +32 -0
  36. package/dist/conductor/prompting.d.ts +74 -0
  37. package/dist/conductor/prompting.js +177 -0
  38. package/dist/config.d.ts +52 -0
  39. package/dist/config.js +163 -0
  40. package/dist/db/database.d.ts +12 -0
  41. package/dist/db/database.js +62 -0
  42. package/dist/db/json.d.ts +8 -0
  43. package/dist/db/json.js +13 -0
  44. package/dist/db/migrations.d.ts +6 -0
  45. package/dist/db/migrations.js +571 -0
  46. package/dist/db/repos/agents.d.ts +86 -0
  47. package/dist/db/repos/agents.js +92 -0
  48. package/dist/db/repos/audit.d.ts +37 -0
  49. package/dist/db/repos/audit.js +20 -0
  50. package/dist/db/repos/events.d.ts +29 -0
  51. package/dist/db/repos/events.js +55 -0
  52. package/dist/db/repos/files.d.ts +41 -0
  53. package/dist/db/repos/files.js +72 -0
  54. package/dist/db/repos/idempotency.d.ts +27 -0
  55. package/dist/db/repos/idempotency.js +46 -0
  56. package/dist/db/repos/links.d.ts +47 -0
  57. package/dist/db/repos/links.js +99 -0
  58. package/dist/db/repos/projects.d.ts +44 -0
  59. package/dist/db/repos/projects.js +107 -0
  60. package/dist/db/repos/proposals.d.ts +46 -0
  61. package/dist/db/repos/proposals.js +65 -0
  62. package/dist/db/repos/review.d.ts +191 -0
  63. package/dist/db/repos/review.js +195 -0
  64. package/dist/db/repos/room.d.ts +163 -0
  65. package/dist/db/repos/room.js +151 -0
  66. package/dist/db/repos/sessions.d.ts +36 -0
  67. package/dist/db/repos/sessions.js +30 -0
  68. package/dist/db/repos/summaries.d.ts +22 -0
  69. package/dist/db/repos/summaries.js +105 -0
  70. package/dist/db/repos/tasks.d.ts +103 -0
  71. package/dist/db/repos/tasks.js +112 -0
  72. package/dist/db/repos/team.d.ts +49 -0
  73. package/dist/db/repos/team.js +95 -0
  74. package/dist/db/repos/templates.d.ts +55 -0
  75. package/dist/db/repos/templates.js +120 -0
  76. package/dist/db/store.d.ts +57 -0
  77. package/dist/db/store.js +108 -0
  78. package/dist/events/bus.d.ts +21 -0
  79. package/dist/events/bus.js +31 -0
  80. package/dist/events/types.d.ts +3 -0
  81. package/dist/events/types.js +1 -0
  82. package/dist/ids.d.ts +28 -0
  83. package/dist/ids.js +81 -0
  84. package/dist/index.d.ts +18 -0
  85. package/dist/index.js +17 -0
  86. package/dist/knowledge/extract.d.ts +17 -0
  87. package/dist/knowledge/extract.js +82 -0
  88. package/dist/knowledge/sync.d.ts +40 -0
  89. package/dist/knowledge/sync.js +172 -0
  90. package/dist/logger.d.ts +5 -0
  91. package/dist/logger.js +11 -0
  92. package/dist/main.d.ts +2 -0
  93. package/dist/main.js +42 -0
  94. package/dist/review/anchors.d.ts +16 -0
  95. package/dist/review/anchors.js +67 -0
  96. package/dist/review/context.d.ts +4 -0
  97. package/dist/review/context.js +29 -0
  98. package/dist/review/docx.d.ts +29 -0
  99. package/dist/review/docx.js +21 -0
  100. package/dist/review/export.d.ts +16 -0
  101. package/dist/review/export.js +84 -0
  102. package/dist/review/importer.d.ts +68 -0
  103. package/dist/review/importer.js +215 -0
  104. package/dist/review/index.d.ts +13 -0
  105. package/dist/review/index.js +7 -0
  106. package/dist/server/app.d.ts +5 -0
  107. package/dist/server/app.js +44 -0
  108. package/dist/server/deps.d.ts +43 -0
  109. package/dist/server/deps.js +17 -0
  110. package/dist/server/env.d.ts +6 -0
  111. package/dist/server/env.js +1 -0
  112. package/dist/server/errors.d.ts +12 -0
  113. package/dist/server/errors.js +25 -0
  114. package/dist/server/routes/agent-studio.d.ts +5 -0
  115. package/dist/server/routes/agent-studio.js +441 -0
  116. package/dist/server/routes/agents.d.ts +3 -0
  117. package/dist/server/routes/agents.js +4 -0
  118. package/dist/server/routes/files.d.ts +3 -0
  119. package/dist/server/routes/files.js +88 -0
  120. package/dist/server/routes/health.d.ts +3 -0
  121. package/dist/server/routes/health.js +31 -0
  122. package/dist/server/routes/links.d.ts +3 -0
  123. package/dist/server/routes/links.js +79 -0
  124. package/dist/server/routes/projects.d.ts +3 -0
  125. package/dist/server/routes/projects.js +119 -0
  126. package/dist/server/routes/review.d.ts +3 -0
  127. package/dist/server/routes/review.js +198 -0
  128. package/dist/server/routes/room.d.ts +9 -0
  129. package/dist/server/routes/room.js +224 -0
  130. package/dist/server/routes/stream.d.ts +4 -0
  131. package/dist/server/routes/stream.js +104 -0
  132. package/dist/server/routes/team.d.ts +3 -0
  133. package/dist/server/routes/team.js +183 -0
  134. package/dist/server/routes/templates.d.ts +11 -0
  135. package/dist/server/routes/templates.js +103 -0
  136. package/dist/server/routes/work.d.ts +3 -0
  137. package/dist/server/routes/work.js +139 -0
  138. package/dist/server/routing.d.ts +31 -0
  139. package/dist/server/routing.js +132 -0
  140. package/dist/service.d.ts +34 -0
  141. package/dist/service.js +93 -0
  142. package/dist/shared/browser.d.ts +5824 -0
  143. package/dist/shared/browser.js +1318 -0
  144. package/dist/team/proposals.d.ts +129 -0
  145. package/dist/team/proposals.js +349 -0
  146. package/dist/team/service.d.ts +12 -0
  147. package/dist/team/service.js +13 -0
  148. package/dist/team/validation.d.ts +37 -0
  149. package/dist/team/validation.js +157 -0
  150. package/dist/templates/secrets.d.ts +2 -0
  151. package/dist/templates/secrets.js +23 -0
  152. package/dist/templates/seeds.d.ts +34 -0
  153. package/dist/templates/seeds.js +277 -0
  154. package/dist/url.d.ts +2 -0
  155. package/dist/url.js +7 -0
  156. package/dist/version.d.ts +2 -0
  157. package/dist/version.js +11 -0
  158. package/docs/openapi-browser.json +12658 -0
  159. package/package.json +91 -4
@@ -0,0 +1,851 @@
1
+ import { z } from 'zod';
2
+ import { type SseMessage } from './sse.js';
3
+ import type { ServiceTokenProvider } from './service-token.js';
4
+ export declare const ACTING_SUBJECT_HEADER = "x-acting-subject";
5
+ export declare class MagnusError extends Error {
6
+ readonly status: number;
7
+ readonly code: string;
8
+ name: string;
9
+ constructor(message: string, status: number, code: string);
10
+ }
11
+ export interface AgentRefParts {
12
+ nodeId: string;
13
+ profile: string;
14
+ }
15
+ export declare function parseAgentRef(ref: string): AgentRefParts;
16
+ export declare function agentRef(nodeId: string, profile: string): string;
17
+ export interface CallContext {
18
+ /** The Oathweave subject of the person this call acts for. Omit for Studio's own background work. */
19
+ actingSubject?: string | undefined;
20
+ signal?: AbortSignal | undefined;
21
+ }
22
+ export declare const magnusArdentProfileSchema: z.ZodObject<{
23
+ id: z.ZodString;
24
+ name: z.ZodString;
25
+ backend: z.ZodNullable<z.ZodEnum<{
26
+ llamacpp: "llamacpp";
27
+ codex: "codex";
28
+ }>>;
29
+ apiPort: z.ZodNullable<z.ZodNumber>;
30
+ running: z.ZodBoolean;
31
+ a2aEnabled: z.ZodBoolean;
32
+ channels: z.ZodRecord<z.ZodString, z.ZodBoolean>;
33
+ error: z.ZodNullable<z.ZodString>;
34
+ nodeId: z.ZodString;
35
+ nodeName: z.ZodString;
36
+ hostname: z.ZodString;
37
+ installationVersion: z.ZodNullable<z.ZodString>;
38
+ reachable: z.ZodBoolean;
39
+ }, z.core.$strip>;
40
+ export type MagnusArdentProfile = z.infer<typeof magnusArdentProfileSchema>;
41
+ export declare const magnusArdentInstallationSchema: z.ZodObject<{
42
+ installed: z.ZodBoolean;
43
+ version: z.ZodNullable<z.ZodString>;
44
+ owner: z.ZodString;
45
+ profiles: z.ZodArray<z.ZodObject<{
46
+ error: z.ZodNullable<z.ZodString>;
47
+ name: z.ZodString;
48
+ id: z.ZodString;
49
+ backend: z.ZodNullable<z.ZodEnum<{
50
+ llamacpp: "llamacpp";
51
+ codex: "codex";
52
+ }>>;
53
+ running: z.ZodBoolean;
54
+ apiPort: z.ZodNullable<z.ZodNumber>;
55
+ a2aEnabled: z.ZodBoolean;
56
+ channels: z.ZodRecord<z.ZodString, z.ZodBoolean>;
57
+ }, z.core.$strip>>;
58
+ checkedAt: z.ZodString;
59
+ nodeId: z.ZodString;
60
+ nodeName: z.ZodString;
61
+ hostname: z.ZodString;
62
+ reachable: z.ZodBoolean;
63
+ error: z.ZodNullable<z.ZodString>;
64
+ capabilities: z.ZodOptional<z.ZodObject<{
65
+ studio: z.ZodOptional<z.ZodNumber>;
66
+ }, z.core.$loose>>;
67
+ }, z.core.$strip>;
68
+ export type MagnusArdentInstallation = z.infer<typeof magnusArdentInstallationSchema>;
69
+ export declare const ardentTaskStateSchema: z.ZodEnum<{
70
+ unknown: "unknown";
71
+ failed: "failed";
72
+ partial: "partial";
73
+ queued: "queued";
74
+ running: "running";
75
+ cancelled: "cancelled";
76
+ input_required: "input_required";
77
+ completed: "completed";
78
+ }>;
79
+ export declare const ardentTaskSchema: z.ZodObject<{
80
+ id: z.ZodString;
81
+ caller: z.ZodString;
82
+ context: z.ZodString;
83
+ session_id: z.ZodNullable<z.ZodString>;
84
+ prompt: z.ZodString;
85
+ content_hash: z.ZodString;
86
+ idempotency_key: z.ZodNullable<z.ZodString>;
87
+ backend: z.ZodString;
88
+ state: z.ZodEnum<{
89
+ unknown: "unknown";
90
+ failed: "failed";
91
+ partial: "partial";
92
+ queued: "queued";
93
+ running: "running";
94
+ cancelled: "cancelled";
95
+ input_required: "input_required";
96
+ completed: "completed";
97
+ }>;
98
+ result: z.ZodNullable<z.ZodString>;
99
+ error: z.ZodNullable<z.ZodString>;
100
+ deadline_ms: z.ZodNumber;
101
+ created_ms: z.ZodNumber;
102
+ updated_ms: z.ZodNumber;
103
+ }, z.core.$strip>;
104
+ export declare const ardentTaskEventSchema: z.ZodObject<{
105
+ sequence: z.ZodNumber;
106
+ task_id: z.ZodString;
107
+ kind: z.ZodString;
108
+ detail: z.ZodOptional<z.ZodUnknown>;
109
+ created_ms: z.ZodNumber;
110
+ }, z.core.$strip>;
111
+ export declare const ardentStatusSchema: z.ZodObject<{
112
+ version: z.ZodString;
113
+ profile: z.ZodString;
114
+ backend: z.ZodString;
115
+ tasks: z.ZodNumber;
116
+ }, z.core.$strip>;
117
+ export declare const ardentMemoryStatusSchema: z.ZodObject<{
118
+ status: z.ZodEnum<{
119
+ ready: "ready";
120
+ degraded: "degraded";
121
+ }>;
122
+ agent_id: z.ZodString;
123
+ workspace_id: z.ZodString;
124
+ retrieval: z.ZodNullable<z.ZodString>;
125
+ storage: z.ZodNullable<z.ZodString>;
126
+ reason: z.ZodNullable<z.ZodString>;
127
+ }, z.core.$strip>;
128
+ export declare const ardentSkillSchema: z.ZodObject<{
129
+ name: z.ZodString;
130
+ enabled: z.ZodBoolean;
131
+ }, z.core.$loose>;
132
+ /** Admission of task-submit, mission-submit and preview-submit: durable acceptance, never completion. */
133
+ export declare const ardentAcceptedTaskSchema: z.ZodObject<{
134
+ task_id: z.ZodString;
135
+ state: z.ZodString;
136
+ }, z.core.$strip>;
137
+ /** Profile resources released Magnus lets a caller read (routes/ardent.ts allow-list). */
138
+ export type ArdentResource = 'openapi' | 'status' | 'profile' | 'config' | 'config/schema' | 'providers' | 'channels' | 'peers' | 'peers/config' | 'memory/status' | 'skills' | 'sessions' | 'tasks' | `tasks/${string}` | `tasks/${string}/events` | `sessions/${string}/messages` | 'identity/soul' | 'identity/identity' | 'identity/soul/history' | 'identity/identity/history' | `tasks/${string}/artifacts` | `artifacts/${string}/manifest` | 'development';
139
+ /** Actions released Magnus accepts on POST …/action (an ADMIN person; a service identity gets the Studio subset below). */
140
+ export declare const RELEASED_ACTIONS: readonly ["profile-create", "config-validate", "config-save", "peer-validate", "peer-save", "identity-save", "identity-restore", "provider-test", "channel-test", "peer-test", "memory-search", "task-submit", "task-cancel", "skill-set", "service-start", "service-stop", "service-restart", "package-install", "context-stage", "context-adopt", "context-rollback"];
141
+ /**
142
+ * Actions added for Ardent Project Studio. session-open needs studio >= 1, skill-install studio >= 3 and a
143
+ * Magnus with a HiveSkills registry, the others studio >= 2 and Ardent 2.2.0.
144
+ */
145
+ export declare const STUDIO_ACTIONS: readonly ["session-open", "mission-submit", "task-pause", "task-resume", "preview-submit", "development-note", "skill-install"];
146
+ export type MagnusArdentAction = typeof RELEASED_ACTIONS[number] | typeof STUDIO_ACTIONS[number];
147
+ /**
148
+ * Agent changes Magnus runs for a service identity only with x-acting-subject naming a linked Magnus
149
+ * ADMIN (Magnus ARDENT_SERVICE_ADMIN_ACTIONS). Without one: 403 ACTING_ADMIN_REQUIRED; an unlinked
150
+ * subject: 403 ACTING_SUBJECT_UNLINKED. A stale revision answers 409 CONFLICT. Reading config needs
151
+ * the same acting ADMIN.
152
+ */
153
+ export declare const ARDENT_SERVICE_ADMIN_ACTIONS: readonly ["identity-save", "skill-set", "config-save", "skill-install"];
154
+ /**
155
+ * The only configuration values a service's config-save may change (Magnus ARDENT_SERVICE_CONFIG_PATHS).
156
+ * A change anywhere else answers 403 CONFIG_PATH_FORBIDDEN. An array is one value.
157
+ */
158
+ export declare const ARDENT_SERVICE_CONFIG_PATHS: readonly ["execution.backend", "providers.llamacpp.model", "providers.llamacpp.request_timeout_seconds", "providers.llamacpp.context_window_tokens", "providers.llamacpp.max_output_tokens", "providers.llamacpp.reasoning_effort", "providers.codex.model", "skills.enabled", "artifacts.max_bytes"];
159
+ export type ArdentServiceConfigPath = typeof ARDENT_SERVICE_CONFIG_PATHS[number];
160
+ /**
161
+ * Whether Magnus lets the Studio service identity run service-restart. It does not: a service may run
162
+ * only the session, task, mission, preview, development and ARDENT_SERVICE_ADMIN_ACTIONS actions, so a
163
+ * profile restart stays a person's act in the Magnus console.
164
+ */
165
+ export declare const ARDENT_SERVICE_CAN_RESTART = false;
166
+ /** Node agent Studio levels (Magnus ARDENT_STUDIO_CAPABILITY). */
167
+ export declare const ARDENT_STUDIO_CAPABILITY: {
168
+ readonly bridge: 1;
169
+ readonly missions: 2;
170
+ readonly skillInstall: 3;
171
+ };
172
+ /** Journal event kinds Ardent 2.2.0 adds. Others appear too; readers accept unknown kinds. */
173
+ export declare const ARDENT_STUDIO_EVENT_KINDS: readonly ["mission", "team_handoff", "team_ask_user", "team_propose_decision", "artifact_registered", "development_note", "team_result", "team_result_rejected", "pause_requested", "paused", "resumed", "preview"];
174
+ export declare const ardentSessionContextSchema: z.ZodEnum<{
175
+ direct: "direct";
176
+ mission: "mission";
177
+ preview: "preview";
178
+ }>;
179
+ export type ArdentSessionContext = z.infer<typeof ardentSessionContextSchema>;
180
+ /** GET …/identity/soul and …/identity/identity, and the identity-save answer. */
181
+ export declare const ardentIdentityFileSchema: z.ZodObject<{
182
+ kind: z.ZodEnum<{
183
+ soul: "soul";
184
+ identity: "identity";
185
+ }>;
186
+ name: z.ZodString;
187
+ text: z.ZodString;
188
+ revision: z.ZodString;
189
+ }, z.core.$strip>;
190
+ export type ArdentIdentityFile = z.infer<typeof ardentIdentityFileSchema>;
191
+ /** GET …/config: the raw config.yaml and its revision (the base for skill-set and config-save). Secrets appear only as environment variable names. */
192
+ export declare const ardentConfigFileSchema: z.ZodObject<{
193
+ revision: z.ZodString;
194
+ text: z.ZodString;
195
+ }, z.core.$strip>;
196
+ export type ArdentConfigFile = z.infer<typeof ardentConfigFileSchema>;
197
+ /** The skill-set and config-save answer: the new configuration revision. The change applies once the profile restarts. */
198
+ export declare const ardentConfigSavedSchema: z.ZodObject<{
199
+ revision: z.ZodString;
200
+ activation_required: z.ZodBoolean;
201
+ }, z.core.$strip>;
202
+ export type ArdentConfigSaved = z.infer<typeof ardentConfigSavedSchema>;
203
+ /** action identity-save */
204
+ export declare const ardentIdentityEditSchema: z.ZodObject<{
205
+ text: z.ZodString;
206
+ revision: z.ZodString;
207
+ }, z.core.$strict>;
208
+ /** action skill-set: revision is the configuration revision. */
209
+ export declare const ardentSkillEditSchema: z.ZodObject<{
210
+ enabled: z.ZodBoolean;
211
+ revision: z.ZodString;
212
+ }, z.core.$strict>;
213
+ export declare const ardentSkillTargetSchema: z.ZodString;
214
+ /**
215
+ * action skill-install (Magnus ardentSkillInstallSchema): a HiveSkills catalog release that Magnus fetches,
216
+ * checks against the catalog digest and installs onto the profile; with enable, the configuration revision.
217
+ */
218
+ export declare const ardentSkillInstallSchema: z.ZodObject<{
219
+ source: z.ZodLiteral<"hiveskills">;
220
+ name: z.ZodString;
221
+ version: z.ZodString;
222
+ channel: z.ZodOptional<z.ZodEnum<{
223
+ stable: "stable";
224
+ canary: "canary";
225
+ }>>;
226
+ enable: z.ZodOptional<z.ZodBoolean>;
227
+ revision: z.ZodOptional<z.ZodString>;
228
+ }, z.core.$strict>;
229
+ /** The skill-install answer. A failed enable leaves the skill installed, with enable_error saying why. */
230
+ export declare const ardentSkillInstallResultSchema: z.ZodObject<{
231
+ source: z.ZodLiteral<"hiveskills">;
232
+ name: z.ZodString;
233
+ version: z.ZodString;
234
+ sha256: z.ZodString;
235
+ files: z.ZodNumber;
236
+ changed: z.ZodBoolean;
237
+ enabled: z.ZodBoolean;
238
+ revision: z.ZodNullable<z.ZodString>;
239
+ enable_error: z.ZodNullable<z.ZodString>;
240
+ activation_required: z.ZodBoolean;
241
+ }, z.core.$strip>;
242
+ export type ArdentSkillInstallResult = z.infer<typeof ardentSkillInstallResultSchema>;
243
+ /** action config-save: the whole config.yaml and the configuration revision it replaces. */
244
+ export declare const ardentConfigEditSchema: z.ZodObject<{
245
+ text: z.ZodString;
246
+ revision: z.ZodString;
247
+ }, z.core.$strict>;
248
+ /** action session-open */
249
+ export declare const ardentSessionOpenSchema: z.ZodObject<{
250
+ key: z.ZodString;
251
+ reset: z.ZodOptional<z.ZodBoolean>;
252
+ context: z.ZodOptional<z.ZodEnum<{
253
+ direct: "direct";
254
+ mission: "mission";
255
+ preview: "preview";
256
+ }>>;
257
+ }, z.core.$strict>;
258
+ export declare const ardentSessionSchema: z.ZodObject<{
259
+ id: z.ZodString;
260
+ caller: z.ZodString;
261
+ context: z.ZodString;
262
+ key: z.ZodString;
263
+ created_ms: z.ZodNumber;
264
+ updated_ms: z.ZodNumber;
265
+ }, z.core.$strip>;
266
+ /** action task-submit */
267
+ export declare const ardentTaskSubmitSchema: z.ZodObject<{
268
+ prompt: z.ZodString;
269
+ idempotency_key: z.ZodString;
270
+ session_id: z.ZodOptional<z.ZodString>;
271
+ }, z.core.$strict>;
272
+ /** Ardent TeamMission 1.0 (src/team-contract.ts). */
273
+ export declare const ardentTeamMissionSchema: z.ZodObject<{
274
+ id: z.ZodString;
275
+ revision: z.ZodNumber;
276
+ parent_task: z.ZodNullable<z.ZodString>;
277
+ constraints: z.ZodArray<z.ZodString>;
278
+ allowed_actions: z.ZodArray<z.ZodEnum<{
279
+ deploy: "deploy";
280
+ observe: "observe";
281
+ analyze: "analyze";
282
+ create_artifact: "create_artifact";
283
+ create_draft: "create_draft";
284
+ reversible_change: "reversible_change";
285
+ external_publish: "external_publish";
286
+ destructive_response: "destructive_response";
287
+ }>>;
288
+ resources: z.ZodArray<z.ZodString>;
289
+ deadline: z.ZodNumber;
290
+ acceptance_criteria: z.ZodArray<z.ZodString>;
291
+ expected_artifacts: z.ZodArray<z.ZodString>;
292
+ }, z.core.$strict>;
293
+ export type ArdentTeamMission = z.infer<typeof ardentTeamMissionSchema>;
294
+ export declare const ARDENT_CONTEXT_ITEMS_MAX_BYTES: number;
295
+ export declare const ardentContextItemSchema: z.ZodObject<{
296
+ title: z.ZodString;
297
+ mime: z.ZodOptional<z.ZodString>;
298
+ text: z.ZodString;
299
+ }, z.core.$strict>;
300
+ export type ArdentContextItem = z.infer<typeof ardentContextItemSchema>;
301
+ /** action mission-submit (the whole action body is at most 200 KB). The session must have context mission. */
302
+ export declare const ardentMissionSubmitSchema: z.ZodObject<{
303
+ session_id: z.ZodOptional<z.ZodString>;
304
+ objective: z.ZodString;
305
+ mission: z.ZodObject<{
306
+ id: z.ZodString;
307
+ revision: z.ZodNumber;
308
+ parent_task: z.ZodNullable<z.ZodString>;
309
+ constraints: z.ZodArray<z.ZodString>;
310
+ allowed_actions: z.ZodArray<z.ZodEnum<{
311
+ deploy: "deploy";
312
+ observe: "observe";
313
+ analyze: "analyze";
314
+ create_artifact: "create_artifact";
315
+ create_draft: "create_draft";
316
+ reversible_change: "reversible_change";
317
+ external_publish: "external_publish";
318
+ destructive_response: "destructive_response";
319
+ }>>;
320
+ resources: z.ZodArray<z.ZodString>;
321
+ deadline: z.ZodNumber;
322
+ acceptance_criteria: z.ZodArray<z.ZodString>;
323
+ expected_artifacts: z.ZodArray<z.ZodString>;
324
+ }, z.core.$strict>;
325
+ context_items: z.ZodOptional<z.ZodArray<z.ZodObject<{
326
+ title: z.ZodString;
327
+ mime: z.ZodOptional<z.ZodString>;
328
+ text: z.ZodString;
329
+ }, z.core.$strict>>>;
330
+ labels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
331
+ idempotency_key: z.ZodString;
332
+ }, z.core.$strict>;
333
+ export type ArdentMissionSubmit = z.infer<typeof ardentMissionSubmitSchema>;
334
+ /** action preview-submit (at most 300 KB). Needs x-acting-subject. */
335
+ export declare const ardentPreviewOverridesSchema: z.ZodObject<{
336
+ soul: z.ZodOptional<z.ZodString>;
337
+ identity: z.ZodOptional<z.ZodString>;
338
+ skills_enabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
339
+ model: z.ZodOptional<z.ZodString>;
340
+ }, z.core.$strict>;
341
+ export declare const ardentPreviewSubmitSchema: z.ZodObject<{
342
+ prompt: z.ZodString;
343
+ overrides: z.ZodOptional<z.ZodObject<{
344
+ soul: z.ZodOptional<z.ZodString>;
345
+ identity: z.ZodOptional<z.ZodString>;
346
+ skills_enabled: z.ZodOptional<z.ZodArray<z.ZodString>>;
347
+ model: z.ZodOptional<z.ZodString>;
348
+ }, z.core.$strict>>;
349
+ session_id: z.ZodOptional<z.ZodString>;
350
+ idempotency_key: z.ZodOptional<z.ZodString>;
351
+ }, z.core.$strict>;
352
+ export type ArdentPreviewSubmit = z.infer<typeof ardentPreviewSubmitSchema>;
353
+ /** action development-note. Needs x-acting-subject. */
354
+ export declare const ardentDevelopmentNoteSchema: z.ZodObject<{
355
+ kind: z.ZodString;
356
+ title: z.ZodString;
357
+ body: z.ZodString;
358
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
359
+ kind: z.ZodEnum<{
360
+ url: "url";
361
+ task: "task";
362
+ identity: "identity";
363
+ note: "note";
364
+ artifact: "artifact";
365
+ memory: "memory";
366
+ skill: "skill";
367
+ }>;
368
+ ref: z.ZodString;
369
+ }, z.core.$strict>>>;
370
+ author: z.ZodOptional<z.ZodEnum<{
371
+ agent: "agent";
372
+ operator: "operator";
373
+ }>>;
374
+ }, z.core.$strict>;
375
+ export declare const ardentDevelopmentRecordSchema: z.ZodObject<{
376
+ id: z.ZodString;
377
+ agent_ref: z.ZodString;
378
+ kind: z.ZodString;
379
+ title: z.ZodString;
380
+ body: z.ZodString;
381
+ author: z.ZodEnum<{
382
+ agent: "agent";
383
+ operator: "operator";
384
+ runtime: "runtime";
385
+ }>;
386
+ epistemic: z.ZodEnum<{
387
+ agent_reported: "agent_reported";
388
+ operator_reported: "operator_reported";
389
+ observed: "observed";
390
+ }>;
391
+ before_sha256: z.ZodNullable<z.ZodString>;
392
+ after_sha256: z.ZodNullable<z.ZodString>;
393
+ sources: z.ZodArray<z.ZodObject<{
394
+ kind: z.ZodString;
395
+ ref: z.ZodString;
396
+ }, z.core.$strip>>;
397
+ created_at: z.ZodString;
398
+ }, z.core.$strip>;
399
+ export type ArdentDevelopmentRecord = z.infer<typeof ardentDevelopmentRecordSchema>;
400
+ export declare const ardentDevelopmentPageSchema: z.ZodObject<{
401
+ records: z.ZodArray<z.ZodObject<{
402
+ id: z.ZodString;
403
+ agent_ref: z.ZodString;
404
+ kind: z.ZodString;
405
+ title: z.ZodString;
406
+ body: z.ZodString;
407
+ author: z.ZodEnum<{
408
+ agent: "agent";
409
+ operator: "operator";
410
+ runtime: "runtime";
411
+ }>;
412
+ epistemic: z.ZodEnum<{
413
+ agent_reported: "agent_reported";
414
+ operator_reported: "operator_reported";
415
+ observed: "observed";
416
+ }>;
417
+ before_sha256: z.ZodNullable<z.ZodString>;
418
+ after_sha256: z.ZodNullable<z.ZodString>;
419
+ sources: z.ZodArray<z.ZodObject<{
420
+ kind: z.ZodString;
421
+ ref: z.ZodString;
422
+ }, z.core.$strip>>;
423
+ created_at: z.ZodString;
424
+ }, z.core.$strip>>;
425
+ next: z.ZodNullable<z.ZodString>;
426
+ }, z.core.$strip>;
427
+ /** actions task-pause and task-resume. A finished task answers 409. */
428
+ export declare const ardentTaskPauseStateSchema: z.ZodObject<{
429
+ task_id: z.ZodString;
430
+ state: z.ZodString;
431
+ admission: z.ZodEnum<{
432
+ paused: "paused";
433
+ open: "open";
434
+ }>;
435
+ }, z.core.$strip>;
436
+ /** Ardent artifact manifest 1.0 (key fields; Ardent adds others). */
437
+ export declare const ardentArtifactManifestSchema: z.ZodObject<{
438
+ schema_version: z.ZodString;
439
+ name: z.ZodString;
440
+ mime: z.ZodString;
441
+ sha256: z.ZodString;
442
+ size: z.ZodNumber;
443
+ revision: z.ZodNumber;
444
+ supersedes_sha256: z.ZodNullable<z.ZodString>;
445
+ acceptance_status: z.ZodEnum<{
446
+ partial: "partial";
447
+ unreviewed: "unreviewed";
448
+ rejected: "rejected";
449
+ approved: "approved";
450
+ }>;
451
+ created_at: z.ZodNumber;
452
+ expires_at: z.ZodOptional<z.ZodNumber>;
453
+ }, z.core.$loose>;
454
+ export type ArdentArtifactManifest = z.infer<typeof ardentArtifactManifestSchema>;
455
+ export declare const ardentArtifactRecordSchema: z.ZodObject<{
456
+ task_id: z.ZodString;
457
+ superseded_by_sha256: z.ZodNullable<z.ZodString>;
458
+ manifest: z.ZodObject<{
459
+ schema_version: z.ZodString;
460
+ name: z.ZodString;
461
+ mime: z.ZodString;
462
+ sha256: z.ZodString;
463
+ size: z.ZodNumber;
464
+ revision: z.ZodNumber;
465
+ supersedes_sha256: z.ZodNullable<z.ZodString>;
466
+ acceptance_status: z.ZodEnum<{
467
+ partial: "partial";
468
+ unreviewed: "unreviewed";
469
+ rejected: "rejected";
470
+ approved: "approved";
471
+ }>;
472
+ created_at: z.ZodNumber;
473
+ expires_at: z.ZodOptional<z.ZodNumber>;
474
+ }, z.core.$loose>;
475
+ }, z.core.$strip>;
476
+ export declare const ardentTaskArtifactsSchema: z.ZodObject<{
477
+ artifacts: z.ZodArray<z.ZodObject<{
478
+ task_id: z.ZodString;
479
+ superseded_by_sha256: z.ZodNullable<z.ZodString>;
480
+ manifest: z.ZodObject<{
481
+ schema_version: z.ZodString;
482
+ name: z.ZodString;
483
+ mime: z.ZodString;
484
+ sha256: z.ZodString;
485
+ size: z.ZodNumber;
486
+ revision: z.ZodNumber;
487
+ supersedes_sha256: z.ZodNullable<z.ZodString>;
488
+ acceptance_status: z.ZodEnum<{
489
+ partial: "partial";
490
+ unreviewed: "unreviewed";
491
+ rejected: "rejected";
492
+ approved: "approved";
493
+ }>;
494
+ created_at: z.ZodNumber;
495
+ expires_at: z.ZodOptional<z.ZodNumber>;
496
+ }, z.core.$loose>;
497
+ }, z.core.$strip>>;
498
+ }, z.core.$strip>;
499
+ /** task.text: the current step's visible reply text (on connect and when a step starts). task.delta appends to it. Never replayed. */
500
+ export declare const ardentTaskTextEventSchema: z.ZodObject<{
501
+ step: z.ZodNumber;
502
+ text: z.ZodString;
503
+ }, z.core.$strip>;
504
+ /** task.event: one journal event; its SSE id is the sequence to resume after. */
505
+ export declare const ardentTaskJournalEventSchema: z.ZodObject<{
506
+ sequence: z.ZodNumber;
507
+ task_id: z.ZodString;
508
+ kind: z.ZodString;
509
+ detail: z.ZodOptional<z.ZodUnknown>;
510
+ created_ms: z.ZodNumber;
511
+ }, z.core.$strip>;
512
+ /** task.done: the final task record. */
513
+ export declare const ardentTaskDoneEventSchema: z.ZodObject<{
514
+ id: z.ZodString;
515
+ state: z.ZodString;
516
+ result: z.ZodOptional<z.ZodNullable<z.ZodString>>;
517
+ error: z.ZodOptional<z.ZodNullable<z.ZodString>>;
518
+ }, z.core.$loose>;
519
+ export type ArdentTaskEvent = z.infer<typeof ardentTaskEventSchema>;
520
+ /** An Emberpath alias or an OpenAI-compatible endpoint and model. Never credentials. */
521
+ export declare const ardentAgentModelSchema: z.ZodUnion<readonly [z.ZodObject<{
522
+ emberpath_alias: z.ZodString;
523
+ }, z.core.$strict>, z.ZodObject<{
524
+ base_url: z.ZodString;
525
+ model: z.ZodString;
526
+ }, z.core.$strict>]>;
527
+ export declare const ardentAgentDeployRequestSchema: z.ZodObject<{
528
+ nodeId: z.ZodString;
529
+ profile: z.ZodString;
530
+ apiPort: z.ZodOptional<z.ZodNumber>;
531
+ soul_md: z.ZodString;
532
+ identity_md: z.ZodString;
533
+ model: z.ZodUnion<readonly [z.ZodObject<{
534
+ emberpath_alias: z.ZodString;
535
+ }, z.core.$strict>, z.ZodObject<{
536
+ base_url: z.ZodString;
537
+ model: z.ZodString;
538
+ }, z.core.$strict>]>;
539
+ skills: z.ZodDefault<z.ZodArray<z.ZodString>>;
540
+ hivemem: z.ZodLiteral<true>;
541
+ artifacts_max_bytes: z.ZodOptional<z.ZodNumber>;
542
+ }, z.core.$strict>;
543
+ export type NewAgentRequest = z.input<typeof ardentAgentDeployRequestSchema>;
544
+ export declare const ardentAgentStepSchema: z.ZodObject<{
545
+ name: z.ZodString;
546
+ status: z.ZodEnum<{
547
+ pending: "pending";
548
+ failed: "failed";
549
+ running: "running";
550
+ succeeded: "succeeded";
551
+ skipped: "skipped";
552
+ }>;
553
+ startedAt: z.ZodNullable<z.ZodString>;
554
+ finishedAt: z.ZodNullable<z.ZodString>;
555
+ receipt: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
556
+ error: z.ZodNullable<z.ZodString>;
557
+ }, z.core.$strip>;
558
+ export declare const agentOperationSchema: z.ZodObject<{
559
+ id: z.ZodString;
560
+ kind: z.ZodEnum<{
561
+ hivemem: "hivemem";
562
+ deploy: "deploy";
563
+ }>;
564
+ nodeId: z.ZodString;
565
+ profile: z.ZodString;
566
+ status: z.ZodEnum<{
567
+ failed: "failed";
568
+ running: "running";
569
+ succeeded: "succeeded";
570
+ }>;
571
+ steps: z.ZodArray<z.ZodObject<{
572
+ name: z.ZodString;
573
+ status: z.ZodEnum<{
574
+ pending: "pending";
575
+ failed: "failed";
576
+ running: "running";
577
+ succeeded: "succeeded";
578
+ skipped: "skipped";
579
+ }>;
580
+ startedAt: z.ZodNullable<z.ZodString>;
581
+ finishedAt: z.ZodNullable<z.ZodString>;
582
+ receipt: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
583
+ error: z.ZodNullable<z.ZodString>;
584
+ }, z.core.$strip>>;
585
+ error: z.ZodNullable<z.ZodString>;
586
+ createdBy: z.ZodString;
587
+ attempts: z.ZodNumber;
588
+ createdAt: z.ZodString;
589
+ updatedAt: z.ZodString;
590
+ completedAt: z.ZodNullable<z.ZodString>;
591
+ }, z.core.$loose>;
592
+ export type MagnusAgentOperation = z.infer<typeof agentOperationSchema>;
593
+ export interface MagnusClientOptions {
594
+ baseUrl: string;
595
+ tokens: Pick<ServiceTokenProvider, 'token' | 'invalidate'>;
596
+ fetch?: typeof fetch;
597
+ timeoutMs?: number;
598
+ }
599
+ export declare class MagnusClient {
600
+ private readonly options;
601
+ private readonly request;
602
+ private readonly baseUrl;
603
+ constructor(options: MagnusClientOptions);
604
+ /** Every Magnus-managed Ardent profile across the fleet. */
605
+ listProfiles(context?: CallContext): Promise<MagnusArdentProfile[]>;
606
+ listInstallations(context?: CallContext): Promise<MagnusArdentInstallation[]>;
607
+ getInstallation(nodeId: string, context?: CallContext): Promise<MagnusArdentInstallation>;
608
+ /** Read an allow-listed Ardent management resource through Magnus. */
609
+ resource(ref: string, resource: ArdentResource, context?: CallContext & {
610
+ query?: {
611
+ after?: number | string;
612
+ limit?: number;
613
+ kind?: string;
614
+ context?: ArdentSessionContext;
615
+ };
616
+ }): Promise<unknown>;
617
+ status(ref: string, context?: CallContext): Promise<{
618
+ version: string;
619
+ profile: string;
620
+ backend: string;
621
+ tasks: number;
622
+ }>;
623
+ memoryStatus(ref: string, context?: CallContext): Promise<{
624
+ status: "ready" | "degraded";
625
+ agent_id: string;
626
+ workspace_id: string;
627
+ retrieval: string | null;
628
+ storage: string | null;
629
+ reason: string | null;
630
+ }>;
631
+ task(ref: string, taskId: string, context?: CallContext): Promise<{
632
+ id: string;
633
+ caller: string;
634
+ context: string;
635
+ session_id: string | null;
636
+ prompt: string;
637
+ content_hash: string;
638
+ idempotency_key: string | null;
639
+ backend: string;
640
+ state: "unknown" | "failed" | "partial" | "queued" | "running" | "cancelled" | "input_required" | "completed";
641
+ result: string | null;
642
+ error: string | null;
643
+ deadline_ms: number;
644
+ created_ms: number;
645
+ updated_ms: number;
646
+ }>;
647
+ skills(ref: string, context?: CallContext): Promise<Array<z.infer<typeof ardentSkillSchema>>>;
648
+ taskEvents(ref: string, taskId: string, after?: number, context?: CallContext): Promise<{
649
+ sequence: number;
650
+ task_id: string;
651
+ kind: string;
652
+ created_ms: number;
653
+ detail?: unknown;
654
+ }[]>;
655
+ identity(ref: string, kind: 'soul' | 'identity', context?: CallContext): Promise<ArdentIdentityFile>;
656
+ /** The profile's config.yaml and its revision. Needs an acting Magnus ADMIN. */
657
+ config(ref: string, context?: CallContext): Promise<ArdentConfigFile>;
658
+ /** Artifact bytes, buffered (Magnus caps them; see MAGNUS_AGENT_ARDENT_ARTIFACT_MAX_BYTES). Prefer artifactStream for large files. */
659
+ artifact(ref: string, sha256: string, context?: CallContext): Promise<Uint8Array>;
660
+ /** Artifact bytes as Magnus streams them, never buffered here. The caller verifies the digest. */
661
+ artifactStream(ref: string, sha256: string, context?: CallContext): Promise<{
662
+ body: ReadableStream<Uint8Array>;
663
+ size: number | undefined;
664
+ }>;
665
+ /** Run a management action through Magnus's audited action route. */
666
+ action(ref: string, action: MagnusArdentAction, input?: {
667
+ target?: string;
668
+ body?: unknown;
669
+ }, context?: CallContext): Promise<unknown>;
670
+ /** A direct task. The prompt is at most 16000 characters; the idempotency key is a UUID; a session (studio >= 1) carries the conversation. */
671
+ submitTask(ref: string, body: z.input<typeof ardentTaskSubmitSchema>, context?: CallContext): Promise<{
672
+ task_id: string;
673
+ state: string;
674
+ }>;
675
+ cancelTask(ref: string, taskId: string, context?: CallContext): Promise<unknown>;
676
+ memorySearch(ref: string, query: string, context?: CallContext): Promise<unknown>;
677
+ /** Ardent rejects a stale revision with 409, so concurrent edits never overwrite each other. */
678
+ saveIdentity(ref: string, kind: 'soul' | 'identity', body: {
679
+ text: string;
680
+ revision: string;
681
+ }, context?: CallContext): Promise<ArdentIdentityFile>;
682
+ /** Each change answers the next configuration revision: chain it into the next skill-set or config-save. */
683
+ setSkill(ref: string, name: string, body: {
684
+ enabled: boolean;
685
+ revision: string;
686
+ }, context?: CallContext): Promise<ArdentConfigSaved>;
687
+ /**
688
+ * Install a HiveSkills catalog release (studio >= 3). Magnus answers 503 HIVESKILLS_UNCONFIGURED without a registry,
689
+ * 409 SKILL_VERSION_UNAVAILABLE or SKILL_CONFLICT, and 422 SKILL_ARCHIVE_INVALID; a Magnus that predates the action
690
+ * answers 400 "Invalid Ardent action".
691
+ */
692
+ installSkill(ref: string, body: z.input<typeof ardentSkillInstallSchema>, context?: CallContext): Promise<ArdentSkillInstallResult>;
693
+ /** Magnus refuses (403 CONFIG_PATH_FORBIDDEN) a text that changes anything outside ARDENT_SERVICE_CONFIG_PATHS. */
694
+ saveConfig(ref: string, body: {
695
+ text: string;
696
+ revision: string;
697
+ }, context?: CallContext): Promise<ArdentConfigSaved>;
698
+ /** The node agent's Studio level for a node: 0 when it reports none. */
699
+ studioLevel(nodeId: string, context?: CallContext): Promise<number>;
700
+ /** Open (or reopen: the same key answers the same session) an Ardent session. studio >= 1; a context needs studio >= 2. */
701
+ openSession(ref: string, body: z.input<typeof ardentSessionOpenSchema>, context?: CallContext): Promise<{
702
+ id: string;
703
+ caller: string;
704
+ context: string;
705
+ key: string;
706
+ created_ms: number;
707
+ updated_ms: number;
708
+ }>;
709
+ /** Submit a team mission in a session opened with context mission. studio >= 2. */
710
+ submitMission(ref: string, body: z.input<typeof ardentMissionSubmitSchema>, context?: CallContext): Promise<{
711
+ task_id: string;
712
+ state: string;
713
+ }>;
714
+ /** Pause at the next step boundary. studio >= 2; a finished task answers 409. */
715
+ pauseTask(ref: string, taskId: string, context?: CallContext): Promise<{
716
+ task_id: string;
717
+ state: string;
718
+ admission: "paused" | "open";
719
+ }>;
720
+ resumeTask(ref: string, taskId: string, context?: CallContext): Promise<{
721
+ task_id: string;
722
+ state: string;
723
+ admission: "paused" | "open";
724
+ }>;
725
+ /** A side-effect-free preview task with draft overrides. studio >= 2; needs the acting person. */
726
+ submitPreview(ref: string, body: z.input<typeof ardentPreviewSubmitSchema>, context: CallContext): Promise<{
727
+ task_id: string;
728
+ state: string;
729
+ }>;
730
+ /** Record a development note. studio >= 2; needs the acting person. */
731
+ addDevelopmentNote(ref: string, body: z.input<typeof ardentDevelopmentNoteSchema>, context: CallContext): Promise<{
732
+ id: string;
733
+ agent_ref: string;
734
+ kind: string;
735
+ title: string;
736
+ body: string;
737
+ author: "agent" | "operator" | "runtime";
738
+ epistemic: "agent_reported" | "operator_reported" | "observed";
739
+ before_sha256: string | null;
740
+ after_sha256: string | null;
741
+ sources: {
742
+ kind: string;
743
+ ref: string;
744
+ }[];
745
+ created_at: string;
746
+ }>;
747
+ /** Artifact manifests a task registered, oldest first. studio >= 2. */
748
+ taskArtifacts(ref: string, taskId: string, context?: CallContext): Promise<{
749
+ task_id: string;
750
+ superseded_by_sha256: string | null;
751
+ manifest: {
752
+ [x: string]: unknown;
753
+ schema_version: string;
754
+ name: string;
755
+ mime: string;
756
+ sha256: string;
757
+ size: number;
758
+ revision: number;
759
+ supersedes_sha256: string | null;
760
+ acceptance_status: "partial" | "unreviewed" | "rejected" | "approved";
761
+ created_at: number;
762
+ expires_at?: number | undefined;
763
+ };
764
+ }[]>;
765
+ /** One artifact manifest. studio >= 2. */
766
+ artifactManifest(ref: string, sha256: string, context?: CallContext): Promise<{
767
+ task_id: string;
768
+ superseded_by_sha256: string | null;
769
+ manifest: {
770
+ [x: string]: unknown;
771
+ schema_version: string;
772
+ name: string;
773
+ mime: string;
774
+ sha256: string;
775
+ size: number;
776
+ revision: number;
777
+ supersedes_sha256: string | null;
778
+ acceptance_status: "partial" | "unreviewed" | "rejected" | "approved";
779
+ created_at: number;
780
+ expires_at?: number | undefined;
781
+ };
782
+ }>;
783
+ /** Portable development records, cursor-paginated. studio >= 2. */
784
+ development(ref: string, query?: {
785
+ after?: string;
786
+ limit?: number;
787
+ kind?: string;
788
+ }, context?: CallContext): Promise<{
789
+ records: {
790
+ id: string;
791
+ agent_ref: string;
792
+ kind: string;
793
+ title: string;
794
+ body: string;
795
+ author: "agent" | "operator" | "runtime";
796
+ epistemic: "agent_reported" | "operator_reported" | "observed";
797
+ before_sha256: string | null;
798
+ after_sha256: string | null;
799
+ sources: {
800
+ kind: string;
801
+ ref: string;
802
+ }[];
803
+ created_at: string;
804
+ }[];
805
+ next: string | null;
806
+ }>;
807
+ /**
808
+ * Follow a task's journal and live reply text (GET …/tasks/:id/stream, piped unbuffered by
809
+ * Magnus). Yields task.event (resumable, id = journal sequence), task.text, task.delta and
810
+ * task.done. Ardent ends a stream after 60 seconds; reconnect with `after`.
811
+ */
812
+ streamTask(ref: string, taskId: string, options?: CallContext & {
813
+ after?: number;
814
+ }): AsyncGenerator<SseMessage>;
815
+ /** Magnus New Agent deploy operation. Magnus runs it only when the acting person is a Magnus ADMIN. */
816
+ createAgent(body: NewAgentRequest, context: CallContext): Promise<{
817
+ operationId: string;
818
+ }>;
819
+ /** Step receipts of a New Agent or Enable HiveMem operation. */
820
+ agentOperation(operationId: string, context?: CallContext): Promise<{
821
+ [x: string]: unknown;
822
+ id: string;
823
+ kind: "hivemem" | "deploy";
824
+ nodeId: string;
825
+ profile: string;
826
+ status: "failed" | "running" | "succeeded";
827
+ steps: {
828
+ name: string;
829
+ status: "pending" | "failed" | "running" | "succeeded" | "skipped";
830
+ startedAt: string | null;
831
+ finishedAt: string | null;
832
+ receipt: Record<string, unknown> | null;
833
+ error: string | null;
834
+ }[];
835
+ error: string | null;
836
+ createdBy: string;
837
+ attempts: number;
838
+ createdAt: string;
839
+ updatedAt: string;
840
+ completedAt: string | null;
841
+ }>;
842
+ /** Live operation updates: `operation` events, then one `done`. */
843
+ streamAgentOperation(operationId: string, options?: CallContext): AsyncGenerator<SseMessage>;
844
+ /** Resume a failed operation from its first unfinished step. Needs an acting ADMIN. */
845
+ resumeAgentOperation(operationId: string, context: CallContext): Promise<{
846
+ operationId: string;
847
+ }>;
848
+ private json;
849
+ private send;
850
+ private fail;
851
+ }