orquesta-cli 0.2.117 → 0.2.118
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.
|
@@ -40,6 +40,7 @@ export declare class ConfigManager {
|
|
|
40
40
|
enableTool(toolId: string): Promise<void>;
|
|
41
41
|
disableTool(toolId: string): Promise<void>;
|
|
42
42
|
hasOrquestaConnection(): boolean;
|
|
43
|
+
getReportingToken(): string | undefined;
|
|
43
44
|
shouldAutoSync(): boolean;
|
|
44
45
|
getOrquestaConfig(): OrquestaConfig | undefined;
|
|
45
46
|
setOrquestaConfig(orquestaConfig: OrquestaConfig): Promise<void>;
|
|
@@ -262,6 +262,9 @@ export class ConfigManager {
|
|
|
262
262
|
}
|
|
263
263
|
return !!this.config.orquesta?.token;
|
|
264
264
|
}
|
|
265
|
+
getReportingToken() {
|
|
266
|
+
return this.config?.orquesta?.token || process.env['ORQUESTA_TOKEN'] || undefined;
|
|
267
|
+
}
|
|
265
268
|
shouldAutoSync() {
|
|
266
269
|
if (!this.config?.orquesta) {
|
|
267
270
|
return false;
|
|
@@ -208,18 +208,19 @@ export async function pushConfigsToOrquesta() {
|
|
|
208
208
|
}
|
|
209
209
|
export async function submitPromptToOrquesta(prompt) {
|
|
210
210
|
const orquestaConfig = configManager.getOrquestaConfig();
|
|
211
|
-
|
|
211
|
+
const reportingToken = configManager.getReportingToken();
|
|
212
|
+
if (!reportingToken) {
|
|
212
213
|
return { success: false, error: 'Not connected to Orquesta' };
|
|
213
214
|
}
|
|
214
215
|
const cwd = prompt.context?.['cwd'] || process.cwd();
|
|
215
216
|
const effectiveProjectId = readHookConfig(cwd)?.projectId ||
|
|
216
217
|
process.env['ORQUESTA_PROJECT_ID'] ||
|
|
217
|
-
orquestaConfig
|
|
218
|
+
orquestaConfig?.projectId;
|
|
218
219
|
try {
|
|
219
220
|
const response = await fetch(`${ORQUESTA_API}/api/orquesta-cli/prompts`, {
|
|
220
221
|
method: 'POST',
|
|
221
222
|
headers: {
|
|
222
|
-
Authorization: `Bearer ${
|
|
223
|
+
Authorization: `Bearer ${reportingToken}`,
|
|
223
224
|
'Content-Type': 'application/json',
|
|
224
225
|
},
|
|
225
226
|
body: JSON.stringify({
|
|
@@ -254,15 +255,15 @@ export async function submitPromptToOrquesta(prompt) {
|
|
|
254
255
|
}
|
|
255
256
|
}
|
|
256
257
|
export async function updatePromptStatus(promptId, update) {
|
|
257
|
-
const
|
|
258
|
-
if (!
|
|
258
|
+
const reportingToken = configManager.getReportingToken();
|
|
259
|
+
if (!reportingToken) {
|
|
259
260
|
return { success: false, error: 'Not connected to Orquesta' };
|
|
260
261
|
}
|
|
261
262
|
try {
|
|
262
263
|
const response = await fetch(`${ORQUESTA_API}/api/orquesta-cli/prompts`, {
|
|
263
264
|
method: 'PATCH',
|
|
264
265
|
headers: {
|
|
265
|
-
Authorization: `Bearer ${
|
|
266
|
+
Authorization: `Bearer ${reportingToken}`,
|
|
266
267
|
'Content-Type': 'application/json',
|
|
267
268
|
},
|
|
268
269
|
body: JSON.stringify({
|
|
@@ -287,15 +288,15 @@ export async function updatePromptStatus(promptId, update) {
|
|
|
287
288
|
}
|
|
288
289
|
}
|
|
289
290
|
export async function streamPromptLogs(promptId, logs) {
|
|
290
|
-
const
|
|
291
|
-
if (!
|
|
291
|
+
const reportingToken = configManager.getReportingToken();
|
|
292
|
+
if (!reportingToken) {
|
|
292
293
|
return { success: false, error: 'Not connected to Orquesta' };
|
|
293
294
|
}
|
|
294
295
|
try {
|
|
295
296
|
const response = await fetch(`${ORQUESTA_API}/api/prompts/${promptId}/logs`, {
|
|
296
297
|
method: 'POST',
|
|
297
298
|
headers: {
|
|
298
|
-
'X-Agent-Token':
|
|
299
|
+
'X-Agent-Token': reportingToken,
|
|
299
300
|
'Content-Type': 'application/json',
|
|
300
301
|
},
|
|
301
302
|
body: JSON.stringify({ logs }),
|
|
@@ -11,7 +11,7 @@ export async function reportPromptStart(content, context) {
|
|
|
11
11
|
if (process.env['ORQUESTA_PROMPT_ID']) {
|
|
12
12
|
return null;
|
|
13
13
|
}
|
|
14
|
-
if (!configManager.
|
|
14
|
+
if (!configManager.getReportingToken()) {
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
try {
|
|
@@ -46,7 +46,7 @@ export async function reportPromptStart(content, context) {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
export async function reportPromptComplete(trackingId, result) {
|
|
49
|
-
if (!trackingId || !configManager.
|
|
49
|
+
if (!trackingId || !configManager.getReportingToken()) {
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
@@ -69,7 +69,7 @@ export async function reportPromptComplete(trackingId, result) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
export async function reportPromptCancelled(trackingId) {
|
|
72
|
-
if (!trackingId || !configManager.
|
|
72
|
+
if (!trackingId || !configManager.getReportingToken()) {
|
|
73
73
|
return;
|
|
74
74
|
}
|
|
75
75
|
try {
|
|
@@ -112,7 +112,7 @@ function describeToolCall(toolName, args) {
|
|
|
112
112
|
}
|
|
113
113
|
export async function reportAssistantOutput(text) {
|
|
114
114
|
const promptId = currentPromptId;
|
|
115
|
-
if (!promptId || !text || !text.trim() || !configManager.
|
|
115
|
+
if (!promptId || !text || !text.trim() || !configManager.getReportingToken()) {
|
|
116
116
|
return;
|
|
117
117
|
}
|
|
118
118
|
try {
|
|
@@ -130,7 +130,7 @@ export async function reportAssistantOutput(text) {
|
|
|
130
130
|
}
|
|
131
131
|
export async function reportTodos(todos, label = 'Plan') {
|
|
132
132
|
const promptId = currentPromptId;
|
|
133
|
-
if (!promptId || !todos || todos.length === 0 || !configManager.
|
|
133
|
+
if (!promptId || !todos || todos.length === 0 || !configManager.getReportingToken()) {
|
|
134
134
|
return;
|
|
135
135
|
}
|
|
136
136
|
try {
|
|
@@ -150,7 +150,7 @@ export async function reportTodos(todos, label = 'Plan') {
|
|
|
150
150
|
}
|
|
151
151
|
export async function reportToolUse(toolName, args, result) {
|
|
152
152
|
const promptId = currentPromptId;
|
|
153
|
-
if (!promptId || !configManager.
|
|
153
|
+
if (!promptId || !configManager.getReportingToken()) {
|
|
154
154
|
return;
|
|
155
155
|
}
|
|
156
156
|
try {
|