@braingrid/cli 0.1.3 ā 0.2.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/CHANGELOG.md +24 -0
- package/README.md +0 -1
- package/dist/cli.js +265 -317
- package/dist/cli.js.map +1 -1
- package/dist/handlers/auth.handlers.d.ts +1 -7
- package/dist/handlers/auth.handlers.d.ts.map +1 -1
- package/dist/handlers/auth.handlers.js +25 -91
- package/dist/handlers/auth.handlers.js.map +1 -1
- package/dist/handlers/index.d.ts +0 -1
- package/dist/handlers/index.d.ts.map +1 -1
- package/dist/handlers/index.js +0 -1
- package/dist/handlers/index.js.map +1 -1
- package/package.json +24 -5
- package/dist/handlers/agent.handlers.d.ts +0 -12
- package/dist/handlers/agent.handlers.d.ts.map +0 -1
- package/dist/handlers/agent.handlers.js +0 -130
- package/dist/handlers/agent.handlers.js.map +0 -1
- package/dist/rpc/registry.d.ts +0 -97
- package/dist/rpc/registry.d.ts.map +0 -1
- package/dist/rpc/registry.js +0 -119
- package/dist/rpc/registry.js.map +0 -1
- package/dist/rpc/server.d.ts +0 -78
- package/dist/rpc/server.d.ts.map +0 -1
- package/dist/rpc/server.js +0 -437
- package/dist/rpc/server.js.map +0 -1
- package/dist/rpc/transport.d.ts +0 -84
- package/dist/rpc/transport.d.ts.map +0 -1
- package/dist/rpc/transport.js +0 -296
- package/dist/rpc/transport.js.map +0 -1
- package/dist/services/__mocks__/utils.d.ts +0 -16
- package/dist/services/__mocks__/utils.d.ts.map +0 -1
- package/dist/services/__mocks__/utils.js +0 -21
- package/dist/services/__mocks__/utils.js.map +0 -1
- package/dist/services/agent-service.d.ts +0 -29
- package/dist/services/agent-service.d.ts.map +0 -1
- package/dist/services/agent-service.js +0 -273
- package/dist/services/agent-service.js.map +0 -1
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Agent Service
|
|
3
|
-
* Handles API interactions for agent conversations
|
|
4
|
-
*/
|
|
5
|
-
import { createAuthenticatedAxios } from '../utils/axios-with-auth.js';
|
|
6
|
-
import { getLogger } from '../utils/logger.js';
|
|
7
|
-
const logger = getLogger();
|
|
8
|
-
/**
|
|
9
|
-
* Format tool arguments or result for display
|
|
10
|
-
* Truncates long values to keep output readable
|
|
11
|
-
*/
|
|
12
|
-
function formatToolData(data, maxLength = 100) {
|
|
13
|
-
try {
|
|
14
|
-
const str = typeof data === 'string' ? data : JSON.stringify(data);
|
|
15
|
-
if (str.length <= maxLength) {
|
|
16
|
-
return str;
|
|
17
|
-
}
|
|
18
|
-
return str.substring(0, maxLength) + '...';
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return String(data).substring(0, maxLength);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export class AgentService {
|
|
25
|
-
constructor(baseUrl, auth) {
|
|
26
|
-
this.baseUrl = baseUrl;
|
|
27
|
-
this.auth = auth;
|
|
28
|
-
this.axios = createAuthenticatedAxios(auth);
|
|
29
|
-
}
|
|
30
|
-
getHeaders() {
|
|
31
|
-
return {
|
|
32
|
-
'Content-Type': 'application/json',
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Stream a conversation with the agent
|
|
37
|
-
* Returns the final response after streaming completes
|
|
38
|
-
*/
|
|
39
|
-
async streamConversation(request) {
|
|
40
|
-
const url = `${this.baseUrl}/api/v1/projects/${request.project}/agent/conversations`;
|
|
41
|
-
const headers = await this.getHeaders();
|
|
42
|
-
const payload = {
|
|
43
|
-
message: request.message,
|
|
44
|
-
conversation_id: request.conversationId,
|
|
45
|
-
context: request.context,
|
|
46
|
-
};
|
|
47
|
-
logger.debug('[AgentService] Making POST request with streaming', {
|
|
48
|
-
url,
|
|
49
|
-
payloadSize: JSON.stringify(payload).length,
|
|
50
|
-
hasConversationId: !!request.conversationId,
|
|
51
|
-
hasContext: !!request.context,
|
|
52
|
-
});
|
|
53
|
-
try {
|
|
54
|
-
// Make POST request with streaming enabled
|
|
55
|
-
// Note: timeout is for the entire request, not inactivity
|
|
56
|
-
// For long-running streams, we set a generous timeout
|
|
57
|
-
const response = (await this.axios.post(url, payload, {
|
|
58
|
-
headers,
|
|
59
|
-
timeout: 600000, // 10 minute timeout for long conversations
|
|
60
|
-
responseType: 'stream', // Enable streaming
|
|
61
|
-
}));
|
|
62
|
-
logger.debug('[AgentService] Received streaming response', {
|
|
63
|
-
status: response.status,
|
|
64
|
-
hasData: !!response.data,
|
|
65
|
-
dataType: typeof response.data,
|
|
66
|
-
isStream: response.data?.readable,
|
|
67
|
-
});
|
|
68
|
-
// Collect chunks from the stream
|
|
69
|
-
return new Promise((resolve, reject) => {
|
|
70
|
-
let buffer = '';
|
|
71
|
-
let conversationId = '';
|
|
72
|
-
let finalStatus = 'complete';
|
|
73
|
-
let assembledContent = '';
|
|
74
|
-
let currentLineLength = 0;
|
|
75
|
-
let inCodeBlock = false;
|
|
76
|
-
let backtickCount = 0; // Track consecutive backticks for code block detection
|
|
77
|
-
const maxLineLength = process.stdout.columns ? process.stdout.columns - 4 : 76;
|
|
78
|
-
// Set up inactivity timeout (stream stops sending data)
|
|
79
|
-
let inactivityTimeout = null;
|
|
80
|
-
const inactivityTimeoutMs = 120000; // 2 minutes of no data
|
|
81
|
-
const resetInactivityTimeout = () => {
|
|
82
|
-
if (inactivityTimeout) {
|
|
83
|
-
clearTimeout(inactivityTimeout);
|
|
84
|
-
}
|
|
85
|
-
inactivityTimeout = setTimeout(() => {
|
|
86
|
-
logger.debug('[AgentService] Stream inactivity timeout - no data for 2 minutes');
|
|
87
|
-
response.data.destroy(new Error('Stream inactivity timeout'));
|
|
88
|
-
}, inactivityTimeoutMs);
|
|
89
|
-
};
|
|
90
|
-
// Start the inactivity timer
|
|
91
|
-
resetInactivityTimeout();
|
|
92
|
-
response.data.on('data', (chunk) => {
|
|
93
|
-
// Reset inactivity timeout on each chunk
|
|
94
|
-
resetInactivityTimeout();
|
|
95
|
-
const chunkStr = chunk.toString();
|
|
96
|
-
buffer += chunkStr;
|
|
97
|
-
// Process complete chunks (separated by \u001e)
|
|
98
|
-
const chunks = buffer.split('\u001e');
|
|
99
|
-
// Keep the last incomplete chunk in the buffer
|
|
100
|
-
buffer = chunks.pop() || '';
|
|
101
|
-
for (const completeChunk of chunks) {
|
|
102
|
-
if (!completeChunk.trim())
|
|
103
|
-
continue;
|
|
104
|
-
try {
|
|
105
|
-
const parsed = JSON.parse(completeChunk);
|
|
106
|
-
if (parsed.conversationId) {
|
|
107
|
-
conversationId = parsed.conversationId;
|
|
108
|
-
}
|
|
109
|
-
if (parsed.status) {
|
|
110
|
-
finalStatus = parsed.status;
|
|
111
|
-
}
|
|
112
|
-
// Parse message content
|
|
113
|
-
if (parsed.message?.content) {
|
|
114
|
-
try {
|
|
115
|
-
const contentObj = JSON.parse(parsed.message.content);
|
|
116
|
-
// Handle different chunk types
|
|
117
|
-
if (contentObj.type === 'text-delta' && contentObj.text) {
|
|
118
|
-
const text = contentObj.text;
|
|
119
|
-
assembledContent += text;
|
|
120
|
-
// Stream characters immediately with micro-batching
|
|
121
|
-
let microBatch = '';
|
|
122
|
-
for (const char of text) {
|
|
123
|
-
// Check for code block markers
|
|
124
|
-
if (char === '`') {
|
|
125
|
-
backtickCount++;
|
|
126
|
-
}
|
|
127
|
-
else {
|
|
128
|
-
backtickCount = 0;
|
|
129
|
-
}
|
|
130
|
-
if (backtickCount === 3) {
|
|
131
|
-
inCodeBlock = !inCodeBlock;
|
|
132
|
-
backtickCount = 0;
|
|
133
|
-
}
|
|
134
|
-
// Handle newlines
|
|
135
|
-
if (char === '\n') {
|
|
136
|
-
microBatch += char;
|
|
137
|
-
process.stdout.write(microBatch);
|
|
138
|
-
microBatch = '';
|
|
139
|
-
currentLineLength = 0;
|
|
140
|
-
continue;
|
|
141
|
-
}
|
|
142
|
-
// Handle word wrapping (only for regular text, not code blocks)
|
|
143
|
-
if (!inCodeBlock && char === ' ' && currentLineLength >= maxLineLength) {
|
|
144
|
-
microBatch += '\n';
|
|
145
|
-
process.stdout.write(microBatch);
|
|
146
|
-
microBatch = '';
|
|
147
|
-
currentLineLength = 0;
|
|
148
|
-
continue;
|
|
149
|
-
}
|
|
150
|
-
// Add character to micro-batch
|
|
151
|
-
microBatch += char;
|
|
152
|
-
currentLineLength++;
|
|
153
|
-
// Flush micro-batch every 5 characters for smooth streaming
|
|
154
|
-
if (microBatch.length >= 5) {
|
|
155
|
-
process.stdout.write(microBatch);
|
|
156
|
-
microBatch = '';
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
// Flush any remaining characters
|
|
160
|
-
if (microBatch) {
|
|
161
|
-
process.stdout.write(microBatch);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
else if (contentObj.type === 'tool-call') {
|
|
165
|
-
// Display tool call with visual indicator
|
|
166
|
-
const toolName = contentObj.toolName || 'unknown';
|
|
167
|
-
const args = contentObj.input ? formatToolData(contentObj.input) : '';
|
|
168
|
-
process.stdout.write('\nš§ Calling tool: ' + toolName);
|
|
169
|
-
if (args) {
|
|
170
|
-
process.stdout.write('\n Arguments: ' + args);
|
|
171
|
-
}
|
|
172
|
-
process.stdout.write('\n');
|
|
173
|
-
currentLineLength = 0;
|
|
174
|
-
}
|
|
175
|
-
else if (contentObj.type === 'tool-input-delta') {
|
|
176
|
-
// Display incremental tool input
|
|
177
|
-
const delta = contentObj.delta || '';
|
|
178
|
-
if (delta) {
|
|
179
|
-
process.stdout.write(delta);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
else if (contentObj.type === 'tool-result') {
|
|
183
|
-
// Display tool result
|
|
184
|
-
const isError = contentObj.result?.isError || false;
|
|
185
|
-
if (isError) {
|
|
186
|
-
const errorMsg = contentObj.result?.content || 'Unknown error';
|
|
187
|
-
process.stdout.write('ā Tool failed: ' + formatToolData(errorMsg) + '\n');
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
process.stdout.write('ā Tool completed\n');
|
|
191
|
-
}
|
|
192
|
-
currentLineLength = 0;
|
|
193
|
-
}
|
|
194
|
-
else if (contentObj.type === 'error') {
|
|
195
|
-
// Display error
|
|
196
|
-
const errorMsg = contentObj.error?.message || contentObj.error || 'Unknown error';
|
|
197
|
-
process.stdout.write('\nā Error: ' + errorMsg + '\n');
|
|
198
|
-
currentLineLength = 0;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
catch {
|
|
202
|
-
// If content is not JSON, treat it as plain text
|
|
203
|
-
assembledContent += parsed.message.content;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
catch {
|
|
208
|
-
logger.debug('[AgentService] Failed to parse chunk', {
|
|
209
|
-
chunk: completeChunk.substring(0, 100),
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
response.data.on('end', () => {
|
|
215
|
-
// Clear inactivity timeout
|
|
216
|
-
if (inactivityTimeout) {
|
|
217
|
-
clearTimeout(inactivityTimeout);
|
|
218
|
-
}
|
|
219
|
-
logger.debug('[AgentService] Stream ended', {
|
|
220
|
-
conversationId,
|
|
221
|
-
status: finalStatus,
|
|
222
|
-
contentLength: assembledContent.length,
|
|
223
|
-
});
|
|
224
|
-
resolve({
|
|
225
|
-
conversationId,
|
|
226
|
-
message: {
|
|
227
|
-
role: 'assistant',
|
|
228
|
-
content: assembledContent || 'No content received',
|
|
229
|
-
},
|
|
230
|
-
status: finalStatus,
|
|
231
|
-
});
|
|
232
|
-
});
|
|
233
|
-
response.data.on('error', (error) => {
|
|
234
|
-
// Clear inactivity timeout
|
|
235
|
-
if (inactivityTimeout) {
|
|
236
|
-
clearTimeout(inactivityTimeout);
|
|
237
|
-
}
|
|
238
|
-
logger.debug('[AgentService] Stream error', { error: error.message });
|
|
239
|
-
reject(error);
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
catch (error) {
|
|
244
|
-
logger.debug('[AgentService] Request failed', {
|
|
245
|
-
error: error instanceof Error ? error.message : String(error),
|
|
246
|
-
errorType: error?.constructor?.name,
|
|
247
|
-
});
|
|
248
|
-
throw error;
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Stream a conversation with callback support for real-time updates
|
|
253
|
-
*/
|
|
254
|
-
async streamConversationWithCallback(request, onChunk) {
|
|
255
|
-
const url = `${this.baseUrl}/api/v1/projects/${request.project}/agent/conversations`;
|
|
256
|
-
const headers = await this.getHeaders();
|
|
257
|
-
const payload = {
|
|
258
|
-
message: request.message,
|
|
259
|
-
conversation_id: request.conversationId,
|
|
260
|
-
context: request.context,
|
|
261
|
-
};
|
|
262
|
-
// Make request with streaming support
|
|
263
|
-
// For now, we'll use a simple POST and call the callback once
|
|
264
|
-
// Future enhancement: Support Server-Sent Events (SSE) or chunked responses
|
|
265
|
-
const response = await this.axios.post(url, payload, {
|
|
266
|
-
headers,
|
|
267
|
-
});
|
|
268
|
-
// Call the callback with the response
|
|
269
|
-
await onChunk(response.data);
|
|
270
|
-
return response.data;
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
//# sourceMappingURL=agent-service.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"agent-service.js","sourceRoot":"","sources":["../../src/services/agent-service.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAG/C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;AAS3B;;;GAGG;AACH,SAAS,cAAc,CAAC,IAAa,EAAE,SAAS,GAAG,GAAG;IACrD,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,GAAG,CAAC,MAAM,IAAI,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