orquesta-cli 0.2.116 → 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.
package/dist/constants.d.ts
CHANGED
|
@@ -5,5 +5,5 @@ export declare const DOCS_DIR: string;
|
|
|
5
5
|
export declare const BACKUPS_DIR: string;
|
|
6
6
|
export declare const PROJECTS_DIR: string;
|
|
7
7
|
export declare function cwdToProjectSegment(cwd?: string): string;
|
|
8
|
-
export declare const APP_VERSION = "0.2.
|
|
8
|
+
export declare const APP_VERSION = "0.2.117";
|
|
9
9
|
//# sourceMappingURL=constants.d.ts.map
|
package/dist/constants.js
CHANGED
|
@@ -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,16 +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
|
-
const effectiveProjectId = readHookConfig(cwd)?.projectId ||
|
|
216
|
+
const effectiveProjectId = readHookConfig(cwd)?.projectId ||
|
|
217
|
+
process.env['ORQUESTA_PROJECT_ID'] ||
|
|
218
|
+
orquestaConfig?.projectId;
|
|
216
219
|
try {
|
|
217
220
|
const response = await fetch(`${ORQUESTA_API}/api/orquesta-cli/prompts`, {
|
|
218
221
|
method: 'POST',
|
|
219
222
|
headers: {
|
|
220
|
-
Authorization: `Bearer ${
|
|
223
|
+
Authorization: `Bearer ${reportingToken}`,
|
|
221
224
|
'Content-Type': 'application/json',
|
|
222
225
|
},
|
|
223
226
|
body: JSON.stringify({
|
|
@@ -252,15 +255,15 @@ export async function submitPromptToOrquesta(prompt) {
|
|
|
252
255
|
}
|
|
253
256
|
}
|
|
254
257
|
export async function updatePromptStatus(promptId, update) {
|
|
255
|
-
const
|
|
256
|
-
if (!
|
|
258
|
+
const reportingToken = configManager.getReportingToken();
|
|
259
|
+
if (!reportingToken) {
|
|
257
260
|
return { success: false, error: 'Not connected to Orquesta' };
|
|
258
261
|
}
|
|
259
262
|
try {
|
|
260
263
|
const response = await fetch(`${ORQUESTA_API}/api/orquesta-cli/prompts`, {
|
|
261
264
|
method: 'PATCH',
|
|
262
265
|
headers: {
|
|
263
|
-
Authorization: `Bearer ${
|
|
266
|
+
Authorization: `Bearer ${reportingToken}`,
|
|
264
267
|
'Content-Type': 'application/json',
|
|
265
268
|
},
|
|
266
269
|
body: JSON.stringify({
|
|
@@ -285,15 +288,15 @@ export async function updatePromptStatus(promptId, update) {
|
|
|
285
288
|
}
|
|
286
289
|
}
|
|
287
290
|
export async function streamPromptLogs(promptId, logs) {
|
|
288
|
-
const
|
|
289
|
-
if (!
|
|
291
|
+
const reportingToken = configManager.getReportingToken();
|
|
292
|
+
if (!reportingToken) {
|
|
290
293
|
return { success: false, error: 'Not connected to Orquesta' };
|
|
291
294
|
}
|
|
292
295
|
try {
|
|
293
296
|
const response = await fetch(`${ORQUESTA_API}/api/prompts/${promptId}/logs`, {
|
|
294
297
|
method: 'POST',
|
|
295
298
|
headers: {
|
|
296
|
-
'X-Agent-Token':
|
|
299
|
+
'X-Agent-Token': reportingToken,
|
|
297
300
|
'Content-Type': 'application/json',
|
|
298
301
|
},
|
|
299
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 {
|