orquesta-cli 0.2.34 → 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.
- package/dist/core/slash-command-handler.js +3 -1
- package/dist/orquesta/hook-init.d.ts +2 -0
- package/dist/orquesta/hook-init.js +3 -3
- package/dist/orquesta/prompt-reporter.d.ts +6 -0
- package/dist/orquesta/prompt-reporter.js +38 -0
- package/dist/tools/llm/simple/simple-tool-executor.js +6 -1
- package/dist/ui/components/PlanExecuteApp.js +3 -3
- package/package.json +1 -1
|
@@ -551,7 +551,8 @@ ${executorLines}
|
|
|
551
551
|
if (sub === 'status') {
|
|
552
552
|
if (!binding)
|
|
553
553
|
return reply('🔌 Claude Code hook: not enabled in this directory.\nEnable it with /hook enable.');
|
|
554
|
-
const name =
|
|
554
|
+
const name = binding.projectName
|
|
555
|
+
|| (oc?.projectId === binding.projectId && oc?.projectName ? oc.projectName : binding.projectId);
|
|
555
556
|
return reply(`🟢 Claude Code hook: enabled here → streaming into ${name}\n Project ID: ${binding.projectId}\n Disable with /hook disable.`);
|
|
556
557
|
}
|
|
557
558
|
if (sub === 'disable') {
|
|
@@ -570,6 +571,7 @@ ${executorLines}
|
|
|
570
571
|
}
|
|
571
572
|
const ok = writeHookFiles({
|
|
572
573
|
projectId: oc.projectId,
|
|
574
|
+
projectName: oc.projectName,
|
|
573
575
|
token: oc.token,
|
|
574
576
|
apiUrl: binding?.apiUrl || 'https://getorquesta.com',
|
|
575
577
|
quiet: true,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export declare function initHooks(token: string, apiUrl?: string, preferredProjectId?: string): Promise<void>;
|
|
2
2
|
export declare function writeHookFiles(opts: {
|
|
3
3
|
projectId: string;
|
|
4
|
+
projectName?: string;
|
|
4
5
|
token: string;
|
|
5
6
|
apiUrl: string;
|
|
6
7
|
cwd?: string;
|
|
@@ -9,6 +10,7 @@ export declare function writeHookFiles(opts: {
|
|
|
9
10
|
}): boolean;
|
|
10
11
|
export declare function readHookConfig(cwd?: string): {
|
|
11
12
|
projectId: string;
|
|
13
|
+
projectName?: string;
|
|
12
14
|
apiUrl?: string;
|
|
13
15
|
} | null;
|
|
14
16
|
export declare function disableHooks(cwd?: string, opts?: {
|
|
@@ -94,7 +94,7 @@ export async function initHooks(token, apiUrl = 'https://getorquesta.com', prefe
|
|
|
94
94
|
process.exit(1);
|
|
95
95
|
}
|
|
96
96
|
const chosen = await resolveTargetProject(projects, preferredProjectId);
|
|
97
|
-
writeHookFiles({ projectId: chosen.id, token, apiUrl, agentBin });
|
|
97
|
+
writeHookFiles({ projectId: chosen.id, projectName: chosen.name, token, apiUrl, agentBin });
|
|
98
98
|
console.log(`
|
|
99
99
|
Done! "${chosen.name}" is wired to this directory.
|
|
100
100
|
Run \`claude\` here and every session streams into Orquesta automatically.
|
|
@@ -108,7 +108,7 @@ export function writeHookFiles(opts) {
|
|
|
108
108
|
console.log(m); };
|
|
109
109
|
try {
|
|
110
110
|
const agentBin = opts.agentBin ?? resolveAgentBin();
|
|
111
|
-
fs.writeFileSync(path.join(cwd, '.orquesta.json'), JSON.stringify({ projectId: opts.projectId, token: opts.token, apiUrl: opts.apiUrl }, null, 2) + '\n');
|
|
111
|
+
fs.writeFileSync(path.join(cwd, '.orquesta.json'), JSON.stringify({ projectId: opts.projectId, ...(opts.projectName ? { projectName: opts.projectName } : {}), token: opts.token, apiUrl: opts.apiUrl }, null, 2) + '\n');
|
|
112
112
|
log(' Created .orquesta.json');
|
|
113
113
|
const gitignorePath = path.join(cwd, '.gitignore');
|
|
114
114
|
const entry = '.orquesta.json';
|
|
@@ -164,7 +164,7 @@ export function readHookConfig(cwd = process.cwd()) {
|
|
|
164
164
|
const data = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
165
165
|
if (!data.projectId)
|
|
166
166
|
return null;
|
|
167
|
-
return { projectId: data.projectId, apiUrl: data.apiUrl };
|
|
167
|
+
return { projectId: data.projectId, projectName: data.projectName, apiUrl: data.apiUrl };
|
|
168
168
|
}
|
|
169
169
|
catch {
|
|
170
170
|
return null;
|
|
@@ -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
|
}
|
|
@@ -94,9 +94,9 @@ export const PlanExecuteApp = ({ llmClient: initialLlmClient, modelInfo }) => {
|
|
|
94
94
|
if (!cfg)
|
|
95
95
|
return null;
|
|
96
96
|
const oc = configManager.getOrquestaConfig();
|
|
97
|
-
const name =
|
|
98
|
-
? oc.projectName
|
|
99
|
-
|
|
97
|
+
const name = cfg.projectName
|
|
98
|
+
|| (oc?.projectId === cfg.projectId && oc?.projectName ? oc.projectName : null)
|
|
99
|
+
|| cfg.projectId.slice(0, 8);
|
|
100
100
|
return { projectName: name };
|
|
101
101
|
}, []);
|
|
102
102
|
const [messages, setMessages] = useState([]);
|