@syntero/orca-cli 1.3.3 → 1.3.5

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.
Files changed (46) hide show
  1. package/dist/assistant/prompts.d.ts.map +1 -1
  2. package/dist/assistant/prompts.js +22 -0
  3. package/dist/assistant/prompts.js.map +1 -1
  4. package/dist/components/ChatApp.d.ts.map +1 -1
  5. package/dist/components/ChatApp.js +8 -6
  6. package/dist/components/ChatApp.js.map +1 -1
  7. package/dist/components/InputFooter.d.ts.map +1 -1
  8. package/dist/components/InputFooter.js +34 -695
  9. package/dist/components/InputFooter.js.map +1 -1
  10. package/dist/components/ResumeMenu.d.ts.map +1 -1
  11. package/dist/components/ResumeMenu.js +24 -3
  12. package/dist/components/ResumeMenu.js.map +1 -1
  13. package/dist/components/hooks/useCommandPalette.d.ts +13 -0
  14. package/dist/components/hooks/useCommandPalette.d.ts.map +1 -0
  15. package/dist/components/hooks/useCommandPalette.js +38 -0
  16. package/dist/components/hooks/useCommandPalette.js.map +1 -0
  17. package/dist/components/hooks/useInputKeyHandler.d.ts +14 -0
  18. package/dist/components/hooks/useInputKeyHandler.d.ts.map +1 -0
  19. package/dist/components/hooks/useInputKeyHandler.js +584 -0
  20. package/dist/components/hooks/useInputKeyHandler.js.map +1 -0
  21. package/dist/components/hooks/useInputLines.d.ts +18 -0
  22. package/dist/components/hooks/useInputLines.d.ts.map +1 -0
  23. package/dist/components/hooks/useInputLines.js +46 -0
  24. package/dist/components/hooks/useInputLines.js.map +1 -0
  25. package/dist/components/hooks/useMenus.d.ts +60 -0
  26. package/dist/components/hooks/useMenus.d.ts.map +1 -0
  27. package/dist/components/hooks/useMenus.js +266 -0
  28. package/dist/components/hooks/useMenus.js.map +1 -0
  29. package/dist/components/hooks/usePasteBlocks.d.ts +14 -0
  30. package/dist/components/hooks/usePasteBlocks.d.ts.map +1 -0
  31. package/dist/components/hooks/usePasteBlocks.js +32 -0
  32. package/dist/components/hooks/usePasteBlocks.js.map +1 -0
  33. package/dist/models.js +4 -4
  34. package/dist/settings.js +1 -1
  35. package/dist/tools/handler.d.ts.map +1 -1
  36. package/dist/tools/handler.js +11 -0
  37. package/dist/tools/handler.js.map +1 -1
  38. package/dist/tools/index.d.ts +152 -0
  39. package/dist/tools/index.d.ts.map +1 -1
  40. package/dist/tools/index.js +2 -0
  41. package/dist/tools/index.js.map +1 -1
  42. package/dist/tools/inference.d.ts +127 -0
  43. package/dist/tools/inference.d.ts.map +1 -0
  44. package/dist/tools/inference.js +318 -0
  45. package/dist/tools/inference.js.map +1 -0
  46. package/package.json +4 -4
@@ -254,6 +254,90 @@ export declare const TOOLS_ANTHROPIC: ({
254
254
  };
255
255
  required: string[];
256
256
  };
257
+ } | {
258
+ name: string;
259
+ description: string;
260
+ input_schema: {
261
+ type: string;
262
+ properties: {
263
+ agent_id: {
264
+ type: string;
265
+ description: string;
266
+ };
267
+ target_dir?: undefined;
268
+ endpoint_url?: undefined;
269
+ model?: undefined;
270
+ prompt?: undefined;
271
+ model_name?: undefined;
272
+ };
273
+ required: string[];
274
+ };
275
+ } | {
276
+ name: string;
277
+ description: string;
278
+ input_schema: {
279
+ type: string;
280
+ properties: {
281
+ agent_id: {
282
+ type: string;
283
+ description: string;
284
+ };
285
+ target_dir: {
286
+ type: string;
287
+ description: string;
288
+ };
289
+ endpoint_url?: undefined;
290
+ model?: undefined;
291
+ prompt?: undefined;
292
+ model_name?: undefined;
293
+ };
294
+ required: string[];
295
+ };
296
+ } | {
297
+ name: string;
298
+ description: string;
299
+ input_schema: {
300
+ type: string;
301
+ properties: {
302
+ endpoint_url: {
303
+ type: string;
304
+ description: string;
305
+ };
306
+ model: {
307
+ type: string;
308
+ description: string;
309
+ };
310
+ prompt: {
311
+ type: string;
312
+ description: string;
313
+ };
314
+ agent_id?: undefined;
315
+ target_dir?: undefined;
316
+ model_name?: undefined;
317
+ };
318
+ required: string[];
319
+ };
320
+ } | {
321
+ name: string;
322
+ description: string;
323
+ input_schema: {
324
+ type: string;
325
+ properties: {
326
+ endpoint_url: {
327
+ type: string;
328
+ description: string;
329
+ };
330
+ model_name: {
331
+ type: string;
332
+ description: string;
333
+ };
334
+ agent_id?: undefined;
335
+ target_dir?: undefined;
336
+ model?: undefined;
337
+ prompt?: undefined;
338
+ };
339
+ required: string[];
340
+ };
257
341
  })[];
258
342
  export declare const TOOLS_OPENAI: {
259
343
  type: "function";
@@ -456,6 +540,74 @@ export declare const TOOLS_OPENAI: {
456
540
  include_prerelease?: undefined;
457
541
  };
458
542
  required: string[];
543
+ } | {
544
+ type: string;
545
+ properties: {
546
+ agent_id: {
547
+ type: string;
548
+ description: string;
549
+ };
550
+ target_dir?: undefined;
551
+ endpoint_url?: undefined;
552
+ model?: undefined;
553
+ prompt?: undefined;
554
+ model_name?: undefined;
555
+ };
556
+ required: string[];
557
+ } | {
558
+ type: string;
559
+ properties: {
560
+ agent_id: {
561
+ type: string;
562
+ description: string;
563
+ };
564
+ target_dir: {
565
+ type: string;
566
+ description: string;
567
+ };
568
+ endpoint_url?: undefined;
569
+ model?: undefined;
570
+ prompt?: undefined;
571
+ model_name?: undefined;
572
+ };
573
+ required: string[];
574
+ } | {
575
+ type: string;
576
+ properties: {
577
+ endpoint_url: {
578
+ type: string;
579
+ description: string;
580
+ };
581
+ model: {
582
+ type: string;
583
+ description: string;
584
+ };
585
+ prompt: {
586
+ type: string;
587
+ description: string;
588
+ };
589
+ agent_id?: undefined;
590
+ target_dir?: undefined;
591
+ model_name?: undefined;
592
+ };
593
+ required: string[];
594
+ } | {
595
+ type: string;
596
+ properties: {
597
+ endpoint_url: {
598
+ type: string;
599
+ description: string;
600
+ };
601
+ model_name: {
602
+ type: string;
603
+ description: string;
604
+ };
605
+ agent_id?: undefined;
606
+ target_dir?: undefined;
607
+ model?: undefined;
608
+ prompt?: undefined;
609
+ };
610
+ required: string[];
459
611
  };
460
612
  };
461
613
  }[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","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MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAS3B,CAAC;AAGF,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAOtB,CAAC"}
@@ -16,6 +16,7 @@ import { DATABASE_TOOLS } from './database.js';
16
16
  import { DOCKER_TOOLS } from './docker.js';
17
17
  import { AUTH_TOOLS } from './auth-tools.js';
18
18
  import { DEPLOYMENT_TOOLS } from './deployment.js';
19
+ import { INFERENCE_TOOLS } from './inference.js';
19
20
  // Tool definitions for Anthropic format
20
21
  export const TOOLS_ANTHROPIC = [
21
22
  ...COMMAND_TOOLS,
@@ -25,6 +26,7 @@ export const TOOLS_ANTHROPIC = [
25
26
  ...DOCKER_TOOLS,
26
27
  ...AUTH_TOOLS,
27
28
  ...DEPLOYMENT_TOOLS,
29
+ ...INFERENCE_TOOLS,
28
30
  ];
29
31
  // Convert to OpenAI format
30
32
  export const TOOLS_OPENAI = TOOLS_ANTHROPIC.map((tool) => ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,kBAAkB;AAClB,OAAO,EACL,sBAAsB,EACtB,YAAY,EACZ,qBAAqB,GAItB,MAAM,YAAY,CAAC;AAEpB,8CAA8C;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,wDAAwD;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,wCAAwC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,GAAG,aAAa;IAChB,GAAG,gBAAgB;IACnB,GAAG,SAAS;IACZ,GAAG,cAAc;IACjB,GAAG,YAAY;IACf,GAAG,UAAU;IACb,GAAG,gBAAgB;CACpB,CAAC;AAEF,2BAA2B;AAC3B,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE,UAAmB;IACzB,QAAQ,EAAE;QACR,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,YAAY;KAC9B;CACF,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","s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ployment assistance.
3
+ *
4
+ * Tools for listing exportable agents, getting deployment configs,
5
+ * downloading adapters, testing endpoints, and configuring local LLM.
6
+ */
7
+ export declare const INFERENCE_TOOLS: ({
8
+ name: string;
9
+ description: string;
10
+ input_schema: {
11
+ type: string;
12
+ properties: {
13
+ agent_id?: undefined;
14
+ target_dir?: undefined;
15
+ endpoint_url?: undefined;
16
+ model?: undefined;
17
+ prompt?: undefined;
18
+ model_name?: undefined;
19
+ };
20
+ required?: undefined;
21
+ };
22
+ } | {
23
+ name: string;
24
+ description: string;
25
+ input_schema: {
26
+ type: string;
27
+ properties: {
28
+ agent_id: {
29
+ type: string;
30
+ description: string;
31
+ };
32
+ target_dir?: undefined;
33
+ endpoint_url?: undefined;
34
+ model?: undefined;
35
+ prompt?: undefined;
36
+ model_name?: undefined;
37
+ };
38
+ required: string[];
39
+ };
40
+ } | {
41
+ name: string;
42
+ description: string;
43
+ input_schema: {
44
+ type: string;
45
+ properties: {
46
+ agent_id: {
47
+ type: string;
48
+ description: string;
49
+ };
50
+ target_dir: {
51
+ type: string;
52
+ description: string;
53
+ };
54
+ endpoint_url?: undefined;
55
+ model?: undefined;
56
+ prompt?: undefined;
57
+ model_name?: undefined;
58
+ };
59
+ required: string[];
60
+ };
61
+ } | {
62
+ name: string;
63
+ description: string;
64
+ input_schema: {
65
+ type: string;
66
+ properties: {
67
+ endpoint_url: {
68
+ type: string;
69
+ description: string;
70
+ };
71
+ model: {
72
+ type: string;
73
+ description: string;
74
+ };
75
+ prompt: {
76
+ type: string;
77
+ description: string;
78
+ };
79
+ agent_id?: undefined;
80
+ target_dir?: undefined;
81
+ model_name?: undefined;
82
+ };
83
+ required: string[];
84
+ };
85
+ } | {
86
+ name: string;
87
+ description: string;
88
+ input_schema: {
89
+ type: string;
90
+ properties: {
91
+ endpoint_url: {
92
+ type: string;
93
+ description: string;
94
+ };
95
+ model_name: {
96
+ type: string;
97
+ description: string;
98
+ };
99
+ agent_id?: undefined;
100
+ target_dir?: undefined;
101
+ model?: undefined;
102
+ prompt?: undefined;
103
+ };
104
+ required: string[];
105
+ };
106
+ })[];
107
+ /**
108
+ * List agents ready for on-premise export.
109
+ */
110
+ export declare function handleListExportableAgents(): Promise<string>;
111
+ /**
112
+ * Get detailed export/deployment info for an agent.
113
+ */
114
+ export declare function handleGetAgentExportInfo(agentId: string): Promise<string>;
115
+ /**
116
+ * Download adapter from platform to local directory.
117
+ */
118
+ export declare function handleDownloadAdapter(agentId: string, targetDir?: string): Promise<string>;
119
+ /**
120
+ * Test an OpenAI-compatible inference endpoint.
121
+ */
122
+ export declare function handleTestInferenceEndpoint(endpointUrl: string, model: string, prompt?: string): Promise<string>;
123
+ /**
124
+ * Configure Orca to use a local vLLM endpoint.
125
+ */
126
+ export declare function handleConfigureLocalLlm(endpointUrl: string, modelName: string): Promise<string>;
127
+ //# sourceMappingURL=inference.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inference.d.ts","sourceRoot":"","sources":["../../src/tools/inference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAwF3B,CAAC;AAEF;;GAEG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,CAAC,CAYlE;AAED;;GAEG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAY/E;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAqEhG;AAED;;GAEG;AACH,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,CAyFjB;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,CAAC,CAiCjB"}
@@ -0,0 +1,318 @@
1
+ /**
2
+ * Inference tools — on-premise vLLM deployment assistance.
3
+ *
4
+ * Tools for listing exportable agents, getting deployment configs,
5
+ * downloading adapters, testing endpoints, and configuring local LLM.
6
+ */
7
+ import * as fs from 'fs';
8
+ import * as path from 'path';
9
+ import * as os from 'os';
10
+ import * as https from 'https';
11
+ import * as http from 'http';
12
+ import { execSync } from 'child_process';
13
+ import { cloudRequest, loadCredentials } from '../auth.js';
14
+ export const INFERENCE_TOOLS = [
15
+ {
16
+ name: 'list_exportable_agents',
17
+ description: `List all agents that are ready for on-premise deployment.
18
+ Shows agents with successful training runs, including base model, adapter status,
19
+ VRAM requirements, and hardware recommendations.
20
+ Use this as the first step when helping a user set up on-premise inference.`,
21
+ input_schema: {
22
+ type: 'object',
23
+ properties: {},
24
+ },
25
+ },
26
+ {
27
+ name: 'get_agent_export_info',
28
+ description: `Get complete deployment configuration for an agent.
29
+ Returns base model details, adapter info, hardware requirements,
30
+ and ready-to-use vLLM launch commands (native and Docker).
31
+ Use after list_exportable_agents to get detailed setup instructions for a specific agent.`,
32
+ input_schema: {
33
+ type: 'object',
34
+ properties: {
35
+ agent_id: { type: 'string', description: 'The agent ID to get export info for' },
36
+ },
37
+ required: ['agent_id'],
38
+ },
39
+ },
40
+ {
41
+ name: 'download_adapter',
42
+ description: `Download a LoRA adapter from the platform to a local directory.
43
+ The adapter is streamed from the platform (which pulls from a private HuggingFace repo)
44
+ as a tar.gz archive and extracted locally. No HuggingFace account needed.
45
+ The adapter can then be loaded by vLLM using --lora-modules flag.`,
46
+ input_schema: {
47
+ type: 'object',
48
+ properties: {
49
+ agent_id: { type: 'string', description: 'The agent ID whose adapter to download' },
50
+ target_dir: {
51
+ type: 'string',
52
+ description: 'Directory to save the adapter to (default: ~/orca-adapters/<agent_id>)',
53
+ },
54
+ },
55
+ required: ['agent_id'],
56
+ },
57
+ },
58
+ {
59
+ name: 'test_inference_endpoint',
60
+ description: `Test an OpenAI-compatible inference endpoint (e.g. vLLM server).
61
+ Sends a simple chat completion request to verify the endpoint is running and responding.
62
+ Supports both base model and LoRA adapter testing.`,
63
+ input_schema: {
64
+ type: 'object',
65
+ properties: {
66
+ endpoint_url: {
67
+ type: 'string',
68
+ description: 'The vLLM endpoint URL (e.g. "http://192.168.1.100:8000/v1")',
69
+ },
70
+ model: {
71
+ type: 'string',
72
+ description: 'Model name to test (base model ID or LoRA adapter name)',
73
+ },
74
+ prompt: {
75
+ type: 'string',
76
+ description: 'Test prompt (default: "What is 2+2? Answer in one word.")',
77
+ },
78
+ },
79
+ required: ['endpoint_url', 'model'],
80
+ },
81
+ },
82
+ {
83
+ name: 'configure_local_llm',
84
+ description: `Point Orca at an on-premise vLLM server for inference.
85
+ Updates the organization's API keys configuration to use a local
86
+ OpenAI-compatible endpoint instead of cloud inference.`,
87
+ input_schema: {
88
+ type: 'object',
89
+ properties: {
90
+ endpoint_url: {
91
+ type: 'string',
92
+ description: 'The vLLM base URL (e.g. "http://192.168.1.100:8000/v1")',
93
+ },
94
+ model_name: {
95
+ type: 'string',
96
+ description: 'Model name as registered in vLLM (base model or adapter name)',
97
+ },
98
+ },
99
+ required: ['endpoint_url', 'model_name'],
100
+ },
101
+ },
102
+ ];
103
+ /**
104
+ * List agents ready for on-premise export.
105
+ */
106
+ export async function handleListExportableAgents() {
107
+ try {
108
+ const response = await cloudRequest('GET', '/api/v2/agent-store/exportable-agents');
109
+ if (response.status !== 200) {
110
+ return `Error: ${response.data?.message || `HTTP ${response.status}`}`;
111
+ }
112
+ return JSON.stringify(response.data, null, 2);
113
+ }
114
+ catch (e) {
115
+ return `Error: ${e instanceof Error ? e.message : String(e)}`;
116
+ }
117
+ }
118
+ /**
119
+ * Get detailed export/deployment info for an agent.
120
+ */
121
+ export async function handleGetAgentExportInfo(agentId) {
122
+ try {
123
+ const response = await cloudRequest('GET', `/api/v2/agent-store/agents/${agentId}/export-info`);
124
+ if (response.status !== 200) {
125
+ return `Error: ${response.data?.message || `HTTP ${response.status}`}`;
126
+ }
127
+ return JSON.stringify(response.data, null, 2);
128
+ }
129
+ catch (e) {
130
+ return `Error: ${e instanceof Error ? e.message : String(e)}`;
131
+ }
132
+ }
133
+ /**
134
+ * Download adapter from platform to local directory.
135
+ */
136
+ export async function handleDownloadAdapter(agentId, targetDir) {
137
+ try {
138
+ const creds = loadCredentials();
139
+ if (!creds) {
140
+ return 'Error: Not authenticated. Run /token first.';
141
+ }
142
+ const adapterDir = targetDir || path.join(os.homedir(), 'orca-adapters', agentId);
143
+ // Create directory if it doesn't exist
144
+ fs.mkdirSync(adapterDir, { recursive: true });
145
+ const url = `${creds.endpoint}/api/v2/agent-store/agents/${agentId}/download-adapter`;
146
+ return new Promise((resolve) => {
147
+ const protocol = url.startsWith('https') ? https : http;
148
+ const req = protocol.get(url, {
149
+ headers: { Authorization: `Bearer ${creds.token}` },
150
+ timeout: 300000, // 5 min — backend downloads from HF before responding
151
+ }, (res) => {
152
+ if (res.statusCode !== 200) {
153
+ let body = '';
154
+ res.on('data', (chunk) => { body += chunk; });
155
+ res.on('end', () => {
156
+ try {
157
+ const parsed = JSON.parse(body);
158
+ resolve(`Error: ${parsed.message || `HTTP ${res.statusCode}`}`);
159
+ }
160
+ catch {
161
+ resolve(`Error: HTTP ${res.statusCode}`);
162
+ }
163
+ });
164
+ return;
165
+ }
166
+ // Save tar.gz to temp file, then extract
167
+ const tmpFile = path.join(os.tmpdir(), `orca-adapter-${agentId}.tar.gz`);
168
+ const writeStream = fs.createWriteStream(tmpFile);
169
+ res.pipe(writeStream);
170
+ writeStream.on('finish', () => {
171
+ // Extract using tar command
172
+ try {
173
+ execSync(`tar xzf "${tmpFile}" -C "${adapterDir}" --strip-components=1`, {
174
+ timeout: 120000,
175
+ });
176
+ fs.unlinkSync(tmpFile);
177
+ resolve(JSON.stringify({
178
+ status: 'success',
179
+ adapter_path: adapterDir,
180
+ message: `Adapter downloaded and extracted to ${adapterDir}`,
181
+ }));
182
+ }
183
+ catch (extractErr) {
184
+ resolve(`Error extracting adapter: ${extractErr instanceof Error ? extractErr.message : String(extractErr)}`);
185
+ }
186
+ });
187
+ writeStream.on('error', (err) => {
188
+ resolve(`Error writing adapter: ${err.message}`);
189
+ });
190
+ });
191
+ req.on('error', (err) => {
192
+ resolve(`Error downloading adapter: ${err.message}`);
193
+ });
194
+ });
195
+ }
196
+ catch (e) {
197
+ return `Error: ${e instanceof Error ? e.message : String(e)}`;
198
+ }
199
+ }
200
+ /**
201
+ * Test an OpenAI-compatible inference endpoint.
202
+ */
203
+ export async function handleTestInferenceEndpoint(endpointUrl, model, prompt) {
204
+ const testPrompt = prompt || 'What is 2+2? Answer in one word.';
205
+ // Ensure URL ends properly
206
+ const baseUrl = endpointUrl.replace(/\/+$/, '');
207
+ const chatUrl = `${baseUrl}/chat/completions`;
208
+ const body = JSON.stringify({
209
+ model,
210
+ messages: [{ role: 'user', content: testPrompt }],
211
+ max_tokens: 100,
212
+ temperature: 0.1,
213
+ });
214
+ return new Promise((resolve) => {
215
+ const protocol = chatUrl.startsWith('https') ? https : http;
216
+ const parsedUrl = new URL(chatUrl);
217
+ const startTime = Date.now();
218
+ const req = protocol.request({
219
+ hostname: parsedUrl.hostname,
220
+ port: parsedUrl.port,
221
+ path: parsedUrl.pathname,
222
+ method: 'POST',
223
+ headers: {
224
+ 'Content-Type': 'application/json',
225
+ 'Content-Length': Buffer.byteLength(body),
226
+ },
227
+ timeout: 60000,
228
+ }, (res) => {
229
+ let data = '';
230
+ res.on('data', (chunk) => { data += chunk; });
231
+ res.on('end', () => {
232
+ const latencyMs = Date.now() - startTime;
233
+ try {
234
+ const parsed = JSON.parse(data);
235
+ if (parsed.choices && parsed.choices.length > 0) {
236
+ resolve(JSON.stringify({
237
+ status: 'success',
238
+ model: parsed.model,
239
+ response: parsed.choices[0].message?.content?.trim(),
240
+ latency_ms: latencyMs,
241
+ usage: parsed.usage,
242
+ }, null, 2));
243
+ }
244
+ else {
245
+ resolve(JSON.stringify({
246
+ status: 'error',
247
+ message: 'No choices in response',
248
+ raw: data.substring(0, 500),
249
+ latency_ms: latencyMs,
250
+ }));
251
+ }
252
+ }
253
+ catch {
254
+ resolve(JSON.stringify({
255
+ status: 'error',
256
+ message: `Invalid JSON response (HTTP ${res.statusCode})`,
257
+ raw: data.substring(0, 500),
258
+ latency_ms: latencyMs,
259
+ }));
260
+ }
261
+ });
262
+ });
263
+ req.on('error', (err) => {
264
+ resolve(JSON.stringify({
265
+ status: 'error',
266
+ message: err.message,
267
+ hint: err.message.includes('ECONNREFUSED')
268
+ ? 'Connection refused. Is the vLLM server running? Check: docker ps or ps aux | grep vllm'
269
+ : undefined,
270
+ }));
271
+ });
272
+ req.on('timeout', () => {
273
+ req.destroy();
274
+ resolve(JSON.stringify({
275
+ status: 'error',
276
+ message: 'Request timed out after 60 seconds',
277
+ hint: 'The first request to vLLM may be slow while the model loads. Try again in a minute.',
278
+ }));
279
+ });
280
+ req.write(body);
281
+ req.end();
282
+ });
283
+ }
284
+ /**
285
+ * Configure Orca to use a local vLLM endpoint.
286
+ */
287
+ export async function handleConfigureLocalLlm(endpointUrl, modelName) {
288
+ try {
289
+ const creds = loadCredentials();
290
+ if (!creds) {
291
+ return 'Error: Not authenticated. Run /token first.';
292
+ }
293
+ const orgId = creds.org_id;
294
+ if (!orgId) {
295
+ return 'Error: No org_id in credentials.';
296
+ }
297
+ const response = await cloudRequest('PUT', `/api/v1/organizations/${orgId}/api-keys`, {
298
+ openai: {
299
+ api_key: 'not-needed',
300
+ endpoint: endpointUrl,
301
+ model: modelName,
302
+ },
303
+ });
304
+ if (response.status !== 200) {
305
+ return `Error: ${response.data?.message || `HTTP ${response.status}`}`;
306
+ }
307
+ return JSON.stringify({
308
+ status: 'success',
309
+ message: `Orca configured to use local vLLM at ${endpointUrl}`,
310
+ model: modelName,
311
+ endpoint: endpointUrl,
312
+ }, null, 2);
313
+ }
314
+ catch (e) {
315
+ return `Error: ${e instanceof Error ? e.message : String(e)}`;
316
+ }
317
+ }
318
+ //# sourceMappingURL=inference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inference.js","sourceRoot":"","sources":["../../src/tools/inference.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B;QACE,IAAI,EAAE,wBAAwB;QAC9B,WAAW,EAAE;;;4EAG2D;QACxE,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE,EAAE;SACf;KACF;IACD;QACE,IAAI,EAAE,uBAAuB;QAC7B,WAAW,EAAE;;;0FAGyE;QACtF,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qCAAqC,EAAE;aACjF;YACD,QAAQ,EAAE,CAAC,UAAU,CAAC;SACvB;KACF;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,WAAW,EAAE;;;kEAGiD;QAC9D,YAAY,EAAE;YACZ,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,wCAAwC,EAAE;gBACnF,UAAU,EAAE;oBACV,IAA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