nexus-agentd 0.1.1 → 0.1.7

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 (46) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +376 -185
  3. package/dist/a2a/runtime.d.ts +32 -0
  4. package/dist/a2a/runtime.js +382 -0
  5. package/dist/acp/runtime.d.ts +14 -3
  6. package/dist/acp/runtime.js +256 -17
  7. package/dist/agent-instructions.d.ts +11 -0
  8. package/dist/agent-instructions.js +44 -0
  9. package/dist/artifact-store.d.ts +41 -0
  10. package/dist/artifact-store.js +340 -0
  11. package/dist/auth.d.ts +13 -0
  12. package/dist/auth.js +77 -0
  13. package/dist/cli.js +58 -1
  14. package/dist/config.d.ts +10 -0
  15. package/dist/config.js +284 -53
  16. package/dist/control-plane.d.ts +92 -0
  17. package/dist/control-plane.js +646 -0
  18. package/dist/drivers/hermes.d.ts +2 -0
  19. package/dist/drivers/hermes.js +10 -0
  20. package/dist/drivers/index.js +6 -0
  21. package/dist/events.js +13 -2
  22. package/dist/index.d.ts +6 -0
  23. package/dist/index.js +15 -3
  24. package/dist/run-store.d.ts +49 -0
  25. package/dist/run-store.js +291 -0
  26. package/dist/server.d.ts +3 -2
  27. package/dist/server.js +913 -41
  28. package/dist/session-contract.d.ts +16 -4
  29. package/dist/session.d.ts +74 -8
  30. package/dist/session.js +433 -38
  31. package/dist/types.d.ts +204 -6
  32. package/dist/types.js +2 -1
  33. package/dist/webui/app.d.ts +1 -0
  34. package/dist/webui/app.js +1074 -0
  35. package/dist/webui/icons.d.ts +9 -0
  36. package/dist/webui/icons.js +10 -0
  37. package/dist/webui/index.d.ts +3 -0
  38. package/dist/webui/index.js +32 -0
  39. package/dist/webui/markup.d.ts +1 -0
  40. package/dist/webui/markup.js +68 -0
  41. package/dist/webui/styles.d.ts +1 -0
  42. package/dist/webui/styles.js +269 -0
  43. package/dist/workspace-files.d.ts +48 -0
  44. package/dist/workspace-files.js +269 -0
  45. package/nexus-agentd.example.json +31 -27
  46. package/package.json +6 -6
package/dist/types.d.ts CHANGED
@@ -1,50 +1,202 @@
1
1
  export type AgentdSessionState = 'created' | 'running' | 'input_required' | 'permission_required' | 'completed' | 'failed' | 'canceled';
2
+ export type AgentdProtocol = 'acp' | 'a2a';
2
3
  export type PermissionPolicy = 'ask' | 'deny';
3
- export declare const agentdDriverKinds: readonly ["opencode", "claude", "codex", "pi", "openclaw"];
4
+ export declare const agentdDriverKinds: readonly ["opencode", "claude", "codex", "pi", "openclaw", "hermes"];
4
5
  export type AgentdDriverKind = (typeof agentdDriverKinds)[number];
5
6
  export interface AgentdDriverConfig {
7
+ protocol?: 'acp';
6
8
  driver: AgentdDriverKind;
7
9
  name?: string;
8
10
  description?: string;
9
11
  enabled?: boolean;
12
+ workspace?: string;
10
13
  command?: string;
11
14
  args?: string[];
12
15
  inheritEnv?: string[];
13
16
  env?: Record<string, string>;
17
+ /** Optional extra instructions appended to the built-in Agent Nexus guidance. */
18
+ instructions?: string;
14
19
  permissionPolicy?: PermissionPolicy;
15
20
  permissionTimeoutMs?: number;
16
21
  }
22
+ export type A2AAuthType = 'none' | 'bearer' | 'header';
23
+ export type A2ATransportPreference = 'auto' | 'jsonrpc' | 'http-json';
24
+ export interface AgentdA2AConfig {
25
+ protocol: 'a2a';
26
+ name?: string;
27
+ description?: string;
28
+ /** Optional extra instructions sent with the first A2A user message. */
29
+ instructions?: string;
30
+ enabled?: boolean;
31
+ /** Full Agent Card JSON URL. Preferred for new configurations. */
32
+ agentCardUrl?: string;
33
+ /** @deprecated Legacy service root used for well-known Agent Card discovery. */
34
+ agentUrl?: string;
35
+ preferredTransport?: A2ATransportPreference;
36
+ auth?: {
37
+ type: A2AAuthType;
38
+ value?: string;
39
+ headerName?: string;
40
+ };
41
+ timeoutMs?: number;
42
+ }
43
+ export type AgentdAgentConfig = AgentdDriverConfig | AgentdA2AConfig;
44
+ export interface AgentdApiKeyScope {
45
+ allAgents: boolean;
46
+ agentIds: string[];
47
+ }
48
+ export interface AgentdApiKeyConfig {
49
+ id: string;
50
+ name: string;
51
+ secret: string;
52
+ enabled: boolean;
53
+ scope: AgentdApiKeyScope;
54
+ createdAt: number;
55
+ lastUsedAt?: number;
56
+ }
17
57
  export interface AgentdConfig {
18
58
  listen: {
19
59
  host: string;
20
60
  port: number;
21
61
  };
22
- authToken: string;
62
+ initialized: boolean;
63
+ /** Legacy data-plane credential. Loaded as an all-agents API key. */
64
+ authToken?: string;
65
+ adminPasswordHash?: string;
66
+ apiKeys?: AgentdApiKeyConfig[];
23
67
  workspaceRoots: string[];
24
68
  maxRequestBytes: number;
69
+ maxAttachmentBytes?: number;
70
+ /** Gateway-owned directory for temporary, anonymously downloadable artifacts. */
71
+ artifactStoragePath?: string;
72
+ /** Maximum size of one published artifact. */
73
+ maxArtifactBytes?: number;
74
+ /** Maximum combined size of all retained published artifacts. */
75
+ maxArtifactStorageBytes?: number;
76
+ /** Maximum number of retained published artifacts. */
77
+ maxPublishedArtifacts?: number;
78
+ /** Maximum number of simultaneous artifact copies. */
79
+ maxConcurrentArtifactPublishes?: number;
80
+ /** Lifetime of a published artifact URL. */
81
+ artifactTtlMs?: number;
25
82
  maxEventsPerSession: number;
26
83
  maxOutputChars: number;
27
84
  sessionTtlMs: number;
28
- agents: Record<string, AgentdDriverConfig>;
85
+ cleanupIntervalMs?: number;
86
+ requestTimeoutMs?: number;
87
+ promptTimeoutMs?: number;
88
+ maxSessions?: number;
89
+ maxSseConnections?: number;
90
+ maxConnections?: number;
91
+ adminSessionTtlMs?: number;
92
+ secureAdminCookies?: boolean;
93
+ agents: Record<string, AgentdAgentConfig>;
94
+ }
95
+ export interface AgentdFileRootView {
96
+ id: string;
97
+ name: string;
98
+ path: string;
99
+ }
100
+ export interface AgentdFileEntryView {
101
+ name: string;
102
+ path: string;
103
+ type: 'file' | 'directory' | 'symlink' | 'other';
104
+ size?: number;
105
+ modifiedAt: number;
106
+ }
107
+ export interface AgentdPublishedFile {
108
+ id: string;
109
+ name: string;
110
+ url: string;
111
+ size: number;
112
+ mediaType: string;
113
+ sha256: string;
114
+ expiresAt: number;
29
115
  }
30
116
  export interface AgentdAgentView {
31
117
  id: string;
32
118
  name: string;
33
119
  description?: string;
34
- protocol: 'acp';
120
+ protocol: AgentdProtocol;
121
+ driver?: AgentdDriverKind;
35
122
  ready: boolean;
123
+ enabled?: boolean;
124
+ workspace?: string;
36
125
  version?: string;
37
126
  error?: string;
127
+ checkedAt?: number;
128
+ responseMs?: number;
129
+ }
130
+ export interface AgentdAgentConfigView {
131
+ id: string;
132
+ protocol: AgentdProtocol;
133
+ name: string;
134
+ description?: string;
135
+ instructions?: string;
136
+ enabled: boolean;
137
+ driver?: AgentdDriverKind;
138
+ workspace?: string;
139
+ permissionPolicy?: PermissionPolicy;
140
+ permissionTimeoutMs?: number;
141
+ agentCardUrl?: string;
142
+ agentUrl?: string;
143
+ preferredTransport?: A2ATransportPreference;
144
+ auth?: {
145
+ type: A2AAuthType;
146
+ headerName?: string;
147
+ configured: boolean;
148
+ };
149
+ timeoutMs?: number;
150
+ }
151
+ export interface AgentdControlPlaneView {
152
+ workspaceRoots: string[];
153
+ driverKinds: AgentdDriverKind[];
154
+ sessionTtlMs: number;
155
+ promptTimeoutMs: number;
156
+ cleanupIntervalMs: number;
157
+ agents: AgentdAgentConfigView[];
158
+ }
159
+ export interface AgentdInputAttachmentView {
160
+ id: string;
161
+ name: string;
162
+ mediaType?: string;
163
+ size: number;
164
+ }
165
+ export interface AgentdInputAttachment {
166
+ id: string;
167
+ name: string;
168
+ mediaType?: string;
169
+ bytes: Buffer;
170
+ }
171
+ export interface AgentdApiKeyView {
172
+ id: string;
173
+ name: string;
174
+ enabled: boolean;
175
+ scope: AgentdApiKeyScope;
176
+ suffix: string;
177
+ createdAt: number;
178
+ lastUsedAt?: number;
179
+ legacy: boolean;
180
+ }
181
+ export interface AgentdApiKeyPrincipal {
182
+ id: string;
183
+ scope: AgentdApiKeyScope;
38
184
  }
39
185
  export interface AgentdPendingRequest {
40
186
  id: string;
41
187
  kind: 'permission' | 'input';
42
188
  prompt: string;
189
+ /** Optional business-facing step, for example `payment` or `pickup_time`. */
190
+ step?: string;
191
+ /** Optional hint for clients rendering the pending interaction. */
192
+ inputType?: 'text' | 'choice' | 'confirmation' | 'payment' | 'unknown';
43
193
  options?: Array<{
44
194
  id: string;
45
195
  name: string;
46
196
  kind?: string;
47
197
  }>;
198
+ /** JSON-safe metadata for the owning integration. Never put secrets here. */
199
+ metadata?: Record<string, unknown>;
48
200
  }
49
201
  export interface AgentdArtifact {
50
202
  id?: string;
@@ -54,23 +206,69 @@ export interface AgentdArtifact {
54
206
  url?: string;
55
207
  filename?: string;
56
208
  mediaType?: string;
209
+ data?: unknown;
210
+ bytesBase64?: string;
57
211
  metadata?: Record<string, unknown>;
58
212
  }
59
213
  export interface AgentdSessionView {
60
214
  id: string;
215
+ runId?: string;
216
+ protocol: AgentdProtocol;
217
+ protocolSessionId?: string;
218
+ /** Backward-compatible alias for ACP clients. */
61
219
  acpSessionId?: string;
62
220
  agentId: string;
63
- workspace: string;
221
+ workspace?: string;
64
222
  state: AgentdSessionState;
65
223
  output?: string;
66
224
  error?: string;
67
225
  artifacts: AgentdArtifact[];
226
+ inputAttachments?: AgentdInputAttachmentView[];
68
227
  pendingRequest?: AgentdPendingRequest;
69
228
  lastEventId?: string;
70
229
  createdAt: number;
71
230
  updatedAt: number;
72
231
  }
73
- export type AgentdEventType = 'session_state' | 'assistant_chunk' | 'thought_chunk' | 'plan' | 'tool_call' | 'tool_update' | 'terminal_output' | 'file_activity' | 'permission_required' | 'input_required' | 'completed' | 'failed' | 'canceled';
232
+ export interface AgentdRunProgress {
233
+ phase: string;
234
+ message?: string;
235
+ percent?: number;
236
+ }
237
+ export interface AgentdRunArtifactView {
238
+ id?: string;
239
+ name?: string;
240
+ description?: string;
241
+ url?: string;
242
+ filename?: string;
243
+ mediaType?: string;
244
+ metadata?: Record<string, unknown>;
245
+ }
246
+ export interface AgentdRunView {
247
+ id: string;
248
+ sessionId: string;
249
+ agentId: string;
250
+ agentName: string;
251
+ protocol: AgentdProtocol;
252
+ workspace?: string;
253
+ protocolSessionId?: string;
254
+ task: string;
255
+ taskTruncated?: boolean;
256
+ state: AgentdSessionState;
257
+ progress: AgentdRunProgress;
258
+ resultSummary?: string;
259
+ error?: string;
260
+ artifactCount: number;
261
+ inputAttachmentCount?: number;
262
+ startedAt: number;
263
+ updatedAt: number;
264
+ endedAt?: number;
265
+ durationMs?: number;
266
+ }
267
+ export interface AgentdRunDetail extends AgentdRunView {
268
+ output?: string;
269
+ artifacts: AgentdRunArtifactView[];
270
+ }
271
+ export type AgentdEventType = 'session_state' | 'assistant_chunk' | 'thought_chunk' | 'plan' | 'tool_call' | 'tool_update' | 'terminal_output' | 'file_activity' | 'artifact' | 'permission_required' | 'input_required' | 'completed' | 'failed' | 'canceled';
74
272
  export interface AgentdEvent {
75
273
  id: string;
76
274
  sessionId: string;
package/dist/types.js CHANGED
@@ -3,5 +3,6 @@ export const agentdDriverKinds = [
3
3
  'claude',
4
4
  'codex',
5
5
  'pi',
6
- 'openclaw'
6
+ 'openclaw',
7
+ 'hermes'
7
8
  ];
@@ -0,0 +1 @@
1
+ export declare const app: string;