orquesta-cli 0.2.35 → 0.2.36
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.
|
@@ -12,6 +12,12 @@ export declare function reportPromptComplete(trackingId: string, result: {
|
|
|
12
12
|
costCents?: number;
|
|
13
13
|
}): Promise<void>;
|
|
14
14
|
export declare function reportPromptCancelled(trackingId: string): Promise<void>;
|
|
15
|
+
export declare function reportAssistantOutput(text: string): Promise<void>;
|
|
16
|
+
export declare function reportTodos(todos: Array<{
|
|
17
|
+
title?: string;
|
|
18
|
+
content?: string;
|
|
19
|
+
status?: string;
|
|
20
|
+
}>, label?: string): Promise<void>;
|
|
15
21
|
export declare function reportToolUse(toolName: string, args: Record<string, unknown>, result: {
|
|
16
22
|
success: boolean;
|
|
17
23
|
output?: string;
|
|
@@ -107,6 +107,44 @@ function describeToolCall(toolName, args) {
|
|
|
107
107
|
return `Using ${toolName}`;
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
+
export async function reportAssistantOutput(text) {
|
|
111
|
+
const promptId = currentPromptId;
|
|
112
|
+
if (!promptId || !text || !text.trim() || !configManager.hasOrquestaConnection()) {
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
try {
|
|
116
|
+
const seq = (currentSequence += 1);
|
|
117
|
+
const content = text.length > 10000 ? `${text.slice(0, 10000)}…` : text;
|
|
118
|
+
await streamPromptLogs(promptId, [
|
|
119
|
+
{ type: 'output', level: 'info', sequence: seq, output: { content } },
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
catch (error) {
|
|
123
|
+
logger.warn('Failed to report assistant output', {
|
|
124
|
+
error: error instanceof Error ? error.message : String(error),
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
export async function reportTodos(todos, label = 'Plan') {
|
|
129
|
+
const promptId = currentPromptId;
|
|
130
|
+
if (!promptId || !todos || todos.length === 0 || !configManager.hasOrquestaConnection()) {
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
try {
|
|
134
|
+
const seq = (currentSequence += 1);
|
|
135
|
+
const lines = todos
|
|
136
|
+
.map(t => `${t.status === 'completed' ? '✅' : t.status === 'in_progress' ? '🔄' : '⬜'} ${t.title ?? t.content ?? ''}`)
|
|
137
|
+
.join('\n');
|
|
138
|
+
await streamPromptLogs(promptId, [
|
|
139
|
+
{ type: 'output', level: 'info', sequence: seq, output: { content: `📝 ${label}:\n${lines}` } },
|
|
140
|
+
]);
|
|
141
|
+
}
|
|
142
|
+
catch (error) {
|
|
143
|
+
logger.warn('Failed to report todos', {
|
|
144
|
+
error: error instanceof Error ? error.message : String(error),
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}
|
|
110
148
|
export async function reportToolUse(toolName, args, result) {
|
|
111
149
|
const promptId = currentPromptId;
|
|
112
150
|
if (!promptId || !configManager.hasOrquestaConnection()) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isLLMSimpleTool } from '../../types.js';
|
|
2
2
|
import { getStreamLogger } from '../../../utils/json-stream-logger.js';
|
|
3
|
-
import { reportToolUse } from '../../../orquesta/prompt-reporter.js';
|
|
3
|
+
import { reportToolUse, reportAssistantOutput, reportTodos } from '../../../orquesta/prompt-reporter.js';
|
|
4
4
|
let toolExecutionCallback = null;
|
|
5
5
|
let toolResponseCallback = null;
|
|
6
6
|
let planCreatedCallback = null;
|
|
@@ -54,21 +54,25 @@ export function emitPlanCreated(todoTitles) {
|
|
|
54
54
|
if (planCreatedCallback) {
|
|
55
55
|
planCreatedCallback(todoTitles);
|
|
56
56
|
}
|
|
57
|
+
void reportTodos(todoTitles.map(t => ({ title: t, status: 'pending' })), 'Plan created');
|
|
57
58
|
}
|
|
58
59
|
export function emitTodoStart(title) {
|
|
59
60
|
if (todoStartCallback) {
|
|
60
61
|
todoStartCallback(title);
|
|
61
62
|
}
|
|
63
|
+
void reportAssistantOutput(`🔄 Task started: ${title}`);
|
|
62
64
|
}
|
|
63
65
|
export function emitTodoComplete(title) {
|
|
64
66
|
if (todoCompleteCallback) {
|
|
65
67
|
todoCompleteCallback(title);
|
|
66
68
|
}
|
|
69
|
+
void reportAssistantOutput(`✅ Completed: ${title}`);
|
|
67
70
|
}
|
|
68
71
|
export function emitTodoFail(title) {
|
|
69
72
|
if (todoFailCallback) {
|
|
70
73
|
todoFailCallback(title);
|
|
71
74
|
}
|
|
75
|
+
void reportAssistantOutput(`❌ Failed: ${title}`);
|
|
72
76
|
}
|
|
73
77
|
export function emitCompact(originalCount, newCount) {
|
|
74
78
|
if (compactCallback) {
|
|
@@ -93,6 +97,7 @@ export function emitAssistantResponse(content) {
|
|
|
93
97
|
assistantResponseCallback(cleanedContent);
|
|
94
98
|
const streamLogger = getStreamLogger();
|
|
95
99
|
streamLogger?.logAssistantResponse(cleanedContent);
|
|
100
|
+
void reportAssistantOutput(cleanedContent);
|
|
96
101
|
}
|
|
97
102
|
}
|
|
98
103
|
}
|