openfox 2.0.17 → 2.0.20
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/agent-defaults/builder.agent.md +1 -2
- package/dist/agent-defaults/code-reviewer.agent.md +1 -1
- package/dist/agent-defaults/planner.agent.md +4 -1
- package/dist/agent-defaults/verifier.agent.md +1 -1
- package/dist/{chat-handler-DTMB43CD.js → chat-handler-KNDSH5WR.js} +7 -7
- package/dist/{chunk-BC7R4HLY.js → chunk-3QQ4QKAU.js} +74 -573
- package/dist/{chunk-LX66KJPL.js → chunk-6PLAWCHQ.js} +31 -56
- package/dist/{chunk-FWJ6YXGA.js → chunk-ASM2Z7JU.js} +3 -3
- package/dist/{chunk-L7TDUIQY.js → chunk-DX37WNM7.js} +28 -3
- package/dist/{chunk-J7KOV4ST.js → chunk-GI24G4OW.js} +3 -3
- package/dist/{chunk-5ANV7YUX.js → chunk-T67KB6ZS.js} +8 -8
- package/dist/{chunk-KYR4NVNX.js → chunk-TVQTTZYW.js} +93 -55
- package/dist/{chunk-MS3PEYZK.js → chunk-VDC2QL2O.js} +5 -5
- package/dist/{chunk-SYG2ENUQ.js → chunk-YBWY4DKY.js} +2 -2
- package/dist/{chunk-YGNOTMV7.js → chunk-YYXOZJYE.js} +2 -2
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{compactor-R7GRFBOU.js → compactor-EOQYEOFS.js} +5 -5
- package/dist/{events-4K52FKPR.js → events-JKPHAR5W.js} +3 -3
- package/dist/{folding-QIBNKYA6.js → folding-PI67HWBR.js} +2 -2
- package/dist/{orchestrator-FNAU26B6.js → orchestrator-ZVPFU2ZF.js} +6 -6
- package/dist/package.json +1 -1
- package/dist/{processor-3YZVK4JT.js → processor-DKAYI3PV.js} +7 -7
- package/dist/{serve-CRZ7NHSP.js → serve-24IV7E3C.js} +9 -9
- package/dist/server/index.js +8 -8
- package/dist/{server-JKNV2NCJ.js → server-CN7ML6XN.js} +8 -8
- package/dist/{tools-YWC3AJ66.js → tools-ZUOBYTVD.js} +5 -5
- package/dist/web/assets/index-00migM5L.js +301 -0
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-e6TyhL8M.js +0 -301
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
tokenFromPassword,
|
|
22
22
|
verifyPassword,
|
|
23
23
|
workflowExists
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-T67KB6ZS.js";
|
|
25
25
|
import {
|
|
26
26
|
agentExists,
|
|
27
27
|
createToolRegistry,
|
|
@@ -61,10 +61,15 @@ import {
|
|
|
61
61
|
setMcpTools,
|
|
62
62
|
setNotifyMcpServersChanged,
|
|
63
63
|
skillExists
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-TVQTTZYW.js";
|
|
65
65
|
import {
|
|
66
66
|
getProject
|
|
67
67
|
} from "./chunk-O4TED6AJ.js";
|
|
68
|
+
import {
|
|
69
|
+
ALWAYS_ALLOWED,
|
|
70
|
+
ALWAYS_ALLOWED_FOR_SUBAGENTS,
|
|
71
|
+
TOP_LEVEL_ONLY_TOOLS
|
|
72
|
+
} from "./chunk-DX37WNM7.js";
|
|
68
73
|
import {
|
|
69
74
|
getPathSeparator,
|
|
70
75
|
isAbsolutePath
|
|
@@ -96,7 +101,7 @@ import {
|
|
|
96
101
|
updateSessionMetadata,
|
|
97
102
|
updateSessionProvider,
|
|
98
103
|
updateSessionRunning
|
|
99
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-YBWY4DKY.js";
|
|
100
105
|
import {
|
|
101
106
|
createContextStateMessage
|
|
102
107
|
} from "./chunk-F4PMNP7S.js";
|
|
@@ -136,18 +141,19 @@ import {
|
|
|
136
141
|
import express from "express";
|
|
137
142
|
import cors from "cors";
|
|
138
143
|
import { createServer as createHttpServer } from "http";
|
|
139
|
-
import { fileURLToPath as
|
|
140
|
-
import { dirname as
|
|
144
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
145
|
+
import { dirname as dirname5, resolve as resolve3, join as join5 } from "path";
|
|
141
146
|
import { readFile } from "fs/promises";
|
|
142
147
|
import { createServer as createViteServer } from "vite";
|
|
143
148
|
|
|
144
149
|
// src/server/llm/mock.ts
|
|
145
150
|
import { setTimeout as sleep } from "timers/promises";
|
|
151
|
+
|
|
152
|
+
// src/server/llm/mock-rules.ts
|
|
146
153
|
var RULES = [
|
|
147
|
-
//
|
|
154
|
+
// ---------------------------------------------------------------------------
|
|
148
155
|
// Session Metadata Tools (criteria, todos, review_findings)
|
|
149
|
-
//
|
|
150
|
-
// Multi-criteria: ID "crit-a": "First" and ID "crit-b": "Second"
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
151
157
|
{
|
|
152
158
|
match: /ID\s*["']([a-z0-9-]+)["']:\s*["']([^"']+)["'][\s\S]*ID\s*["']([a-z0-9-]+)["']:\s*["']([^"']+)["']/i,
|
|
153
159
|
tools: [
|
|
@@ -156,13 +162,11 @@ var RULES = [
|
|
|
156
162
|
],
|
|
157
163
|
response: "Added both criteria."
|
|
158
164
|
},
|
|
159
|
-
// Single criterion: "Add criterion ID "test-1" with description "The tests pass""
|
|
160
165
|
{
|
|
161
166
|
match: /Add criterion ID\s*["']([a-z0-9-]+)["']\s*with description\s*["']([^"']+)["'][\s\S]*/i,
|
|
162
167
|
tools: [{ name: "session_metadata", arguments: { action: "add", key: "criteria", id: "$1", description: "$2" } }],
|
|
163
168
|
response: "Added the criterion."
|
|
164
169
|
},
|
|
165
|
-
// Single criterion: ID "test-1" with/: description "The tests pass"
|
|
166
170
|
{
|
|
167
171
|
match: /ID\s*["']([a-z0-9-]+)["'].*description\s*["']([^"']+)["']/i,
|
|
168
172
|
tools: [{ name: "session_metadata", arguments: { action: "add", key: "criteria", id: "$1", description: "$2" } }],
|
|
@@ -199,7 +203,6 @@ var RULES = [
|
|
|
199
203
|
],
|
|
200
204
|
response: "Added the criterion."
|
|
201
205
|
},
|
|
202
|
-
// Propose acceptance criteria (for planning prompts)
|
|
203
206
|
{
|
|
204
207
|
match: /propose acceptance criteria/i,
|
|
205
208
|
tools: [
|
|
@@ -224,13 +227,11 @@ var RULES = [
|
|
|
224
227
|
],
|
|
225
228
|
response: "Added criteria for the multiply function."
|
|
226
229
|
},
|
|
227
|
-
// Single criterion: ID "test-1": "The tests pass" (colon format)
|
|
228
230
|
{
|
|
229
231
|
match: /ID\s*["']([a-z0-9-]+)["']\s*:\s*["']([^"']+)["']/i,
|
|
230
232
|
tools: [{ name: "session_metadata", arguments: { action: "add", key: "criteria", id: "$1", description: "$2" } }],
|
|
231
233
|
response: "Added the criterion."
|
|
232
234
|
},
|
|
233
|
-
// session_metadata to mark criteria as completed (natural language)
|
|
234
235
|
{
|
|
235
236
|
match: /session_metadata.*(?:mark|status.*completed).*["']([a-z0-9-]+)["']/i,
|
|
236
237
|
tools: [
|
|
@@ -238,7 +239,6 @@ var RULES = [
|
|
|
238
239
|
],
|
|
239
240
|
response: "Marked criterion as complete."
|
|
240
241
|
},
|
|
241
|
-
// session_metadata to mark criteria as completed (explicit args)
|
|
242
242
|
{
|
|
243
243
|
match: /session_metadata.*action\s*["']update["'].*key\s*["']criteria["'].*id\s*["']([a-z0-9-]+)["'].*status\s*["']completed["']/i,
|
|
244
244
|
tools: [
|
|
@@ -246,13 +246,11 @@ var RULES = [
|
|
|
246
246
|
],
|
|
247
247
|
response: "Marked criterion as complete."
|
|
248
248
|
},
|
|
249
|
-
// session_metadata to mark criteria as passed
|
|
250
249
|
{
|
|
251
250
|
match: /session_metadata.*action\s*["']update["'].*key\s*["']criteria["'].*id\s*["']([a-z0-9-]+)["'].*status\s*["']passed["']/i,
|
|
252
251
|
tools: [{ name: "session_metadata", arguments: { action: "update", key: "criteria", id: "$1", status: "passed" } }],
|
|
253
252
|
response: "Criterion passed."
|
|
254
253
|
},
|
|
255
|
-
// session_metadata to mark criteria as failed
|
|
256
254
|
{
|
|
257
255
|
match: /session_metadata.*action\s*["']update["'].*key\s*["']criteria["'].*id\s*["']([a-z0-9-]+)["'].*status\s*["']failed["']/i,
|
|
258
256
|
tools: [
|
|
@@ -263,13 +261,11 @@ var RULES = [
|
|
|
263
261
|
],
|
|
264
262
|
response: "Criterion failed."
|
|
265
263
|
},
|
|
266
|
-
// get criteria via session_metadata
|
|
267
264
|
{
|
|
268
265
|
match: /get_criteria|show.*criteria|list.*criteria/i,
|
|
269
266
|
tools: [{ name: "session_metadata", arguments: { action: "get", key: "criteria" } }],
|
|
270
267
|
response: "Here are the current criteria."
|
|
271
268
|
},
|
|
272
|
-
// Update criterion via session_metadata
|
|
273
269
|
{
|
|
274
270
|
match: /session_metadata.*action\s*["']update["'].*description/i,
|
|
275
271
|
tools: [
|
|
@@ -280,21 +276,16 @@ var RULES = [
|
|
|
280
276
|
],
|
|
281
277
|
response: "Updated the criterion."
|
|
282
278
|
},
|
|
283
|
-
// Remove criterion via session_metadata
|
|
284
279
|
{
|
|
285
280
|
match: /session_metadata.*action\s*["']remove["']/i,
|
|
286
281
|
tools: [{ name: "session_metadata", arguments: { action: "remove", key: "criteria", id: "0" } }],
|
|
287
282
|
response: "Removed the criterion."
|
|
288
283
|
},
|
|
289
|
-
// Generic add criterion via session_metadata
|
|
290
284
|
{
|
|
291
285
|
match: /add.*criterion/i,
|
|
292
286
|
tools: [{ name: "session_metadata", arguments: { action: "add", key: "criteria", description: "Test criterion" } }],
|
|
293
287
|
response: "Added the criterion."
|
|
294
288
|
},
|
|
295
|
-
// -------------------------------------------------------------------------
|
|
296
|
-
// Session Metadata Tools
|
|
297
|
-
// -------------------------------------------------------------------------
|
|
298
289
|
{
|
|
299
290
|
match: /session_metadata.*action\s*["']add["'].*key\s*["']criteria["'].*description\s*["']([^"']+)["']/i,
|
|
300
291
|
tools: [{ name: "session_metadata", arguments: { action: "add", key: "criteria", description: "$1" } }],
|
|
@@ -322,9 +313,6 @@ var RULES = [
|
|
|
322
313
|
],
|
|
323
314
|
response: "Criterion failed."
|
|
324
315
|
},
|
|
325
|
-
// -------------------------------------------------------------------------
|
|
326
|
-
// File Read Tools
|
|
327
|
-
// -------------------------------------------------------------------------
|
|
328
316
|
{
|
|
329
317
|
match: /read.*src\/math\.ts.*offset|offset.*src\/math\.ts/i,
|
|
330
318
|
tools: [{ name: "read_file", arguments: { path: "src/math.ts", offset: 5 } }],
|
|
@@ -370,9 +358,6 @@ var RULES = [
|
|
|
370
358
|
tools: [{ name: "read_file", arguments: { path: "src/index.ts" } }],
|
|
371
359
|
response: "Read the file."
|
|
372
360
|
},
|
|
373
|
-
// -------------------------------------------------------------------------
|
|
374
|
-
// Glob Tool
|
|
375
|
-
// -------------------------------------------------------------------------
|
|
376
361
|
{
|
|
377
362
|
match: /glob.*\*\*\/\*\.ts|recursive.*typescript/i,
|
|
378
363
|
tools: [{ name: "glob", arguments: { pattern: "**/*.ts" } }],
|
|
@@ -393,9 +378,6 @@ var RULES = [
|
|
|
393
378
|
tools: [{ name: "glob", arguments: { pattern: "**/*" } }],
|
|
394
379
|
response: "Found files."
|
|
395
380
|
},
|
|
396
|
-
// -------------------------------------------------------------------------
|
|
397
|
-
// Grep Tool
|
|
398
|
-
// -------------------------------------------------------------------------
|
|
399
381
|
{
|
|
400
382
|
match: /grep.*XYZNONEXISTENT|search.*XYZNONEXISTENT/i,
|
|
401
383
|
tools: [{ name: "grep", arguments: { pattern: "XYZNONEXISTENT123", path: "." } }],
|
|
@@ -421,10 +403,6 @@ var RULES = [
|
|
|
421
403
|
tools: [{ name: "grep", arguments: { pattern: "export", path: "." } }],
|
|
422
404
|
response: "Searched for pattern."
|
|
423
405
|
},
|
|
424
|
-
// -------------------------------------------------------------------------
|
|
425
|
-
// Write Tool
|
|
426
|
-
// -------------------------------------------------------------------------
|
|
427
|
-
// Path security test rules - writing outside /tmp (requires confirmation)
|
|
428
406
|
{
|
|
429
407
|
match: /write.*\/home\/test\/approved/i,
|
|
430
408
|
tools: [{ name: "write_file", arguments: { path: "/home/test/approved.txt", content: "approved" } }],
|
|
@@ -490,9 +468,6 @@ var RULES = [
|
|
|
490
468
|
tools: [{ name: "write_file", arguments: { path: "src/newfile.ts", content: "export const x = 1" } }],
|
|
491
469
|
response: "Created file."
|
|
492
470
|
},
|
|
493
|
-
// -------------------------------------------------------------------------
|
|
494
|
-
// Edit Tool
|
|
495
|
-
// -------------------------------------------------------------------------
|
|
496
471
|
{
|
|
497
472
|
match: /without reading.*edit_file|edit_file.*without reading/i,
|
|
498
473
|
tools: [{ name: "edit_file", arguments: { path: "src/math.ts", old_string: "function", new_string: "const" } }],
|
|
@@ -536,9 +511,6 @@ var RULES = [
|
|
|
536
511
|
],
|
|
537
512
|
response: "Edited the file."
|
|
538
513
|
},
|
|
539
|
-
// -------------------------------------------------------------------------
|
|
540
|
-
// Shell/Command Tool
|
|
541
|
-
// -------------------------------------------------------------------------
|
|
542
514
|
{
|
|
543
515
|
match: /run.*echo.*first.*sleep.*second/i,
|
|
544
516
|
tools: [{ name: "run_command", arguments: { command: 'echo "first" && sleep 0.2 && echo "second"' } }],
|
|
@@ -617,27 +589,16 @@ var RULES = [
|
|
|
617
589
|
tools: [{ name: "run_command", arguments: { command: 'echo "test"' } }],
|
|
618
590
|
response: "Executed the command."
|
|
619
591
|
},
|
|
620
|
-
// -------------------------------------------------------------------------
|
|
621
|
-
// Todo Tool
|
|
622
|
-
// -------------------------------------------------------------------------
|
|
623
592
|
{
|
|
624
593
|
match: /todo_write.*Read files.*Make changes/i,
|
|
625
594
|
tools: [
|
|
626
595
|
{
|
|
627
596
|
name: "session_metadata",
|
|
628
|
-
arguments: {
|
|
629
|
-
action: "add",
|
|
630
|
-
key: "todos",
|
|
631
|
-
description: "Read files"
|
|
632
|
-
}
|
|
597
|
+
arguments: { action: "add", key: "todos", description: "Read files" }
|
|
633
598
|
},
|
|
634
599
|
{
|
|
635
600
|
name: "session_metadata",
|
|
636
|
-
arguments: {
|
|
637
|
-
action: "add",
|
|
638
|
-
key: "todos",
|
|
639
|
-
description: "Make changes"
|
|
640
|
-
}
|
|
601
|
+
arguments: { action: "add", key: "todos", description: "Make changes" }
|
|
641
602
|
}
|
|
642
603
|
],
|
|
643
604
|
response: "Created todo list."
|
|
@@ -647,18 +608,11 @@ var RULES = [
|
|
|
647
608
|
tools: [
|
|
648
609
|
{
|
|
649
610
|
name: "session_metadata",
|
|
650
|
-
arguments: {
|
|
651
|
-
action: "add",
|
|
652
|
-
key: "todos",
|
|
653
|
-
description: "Test task"
|
|
654
|
-
}
|
|
611
|
+
arguments: { action: "add", key: "todos", description: "Test task" }
|
|
655
612
|
}
|
|
656
613
|
],
|
|
657
614
|
response: "Created todo list."
|
|
658
615
|
},
|
|
659
|
-
// -------------------------------------------------------------------------
|
|
660
|
-
// Mode/Context
|
|
661
|
-
// -------------------------------------------------------------------------
|
|
662
616
|
{
|
|
663
617
|
match: /think.*step.*step/i,
|
|
664
618
|
tools: [],
|
|
@@ -669,10 +623,6 @@ var RULES = [
|
|
|
669
623
|
tools: [],
|
|
670
624
|
response: "Here is a detailed explanation of the topic. TypeScript is a statically typed superset of JavaScript that adds optional type annotations. It provides better tooling, catches errors at compile time, and makes code more maintainable."
|
|
671
625
|
},
|
|
672
|
-
// -------------------------------------------------------------------------
|
|
673
|
-
// Ask User Tool
|
|
674
|
-
// -------------------------------------------------------------------------
|
|
675
|
-
// Specific type rules must come before generic ask rules
|
|
676
626
|
{
|
|
677
627
|
match: /confirm.*question/i,
|
|
678
628
|
tools: [{ name: "ask_user", arguments: { question: "Do you approve?", type: "confirm" } }],
|
|
@@ -702,9 +652,6 @@ var RULES = [
|
|
|
702
652
|
tools: [{ name: "ask_user", arguments: { question: "Should I proceed with this action?" } }],
|
|
703
653
|
response: "I asked for confirmation."
|
|
704
654
|
},
|
|
705
|
-
// -------------------------------------------------------------------------
|
|
706
|
-
// Default Responses (no tools)
|
|
707
|
-
// -------------------------------------------------------------------------
|
|
708
655
|
{
|
|
709
656
|
match: /hello|hi there|introduce yourself/i,
|
|
710
657
|
tools: [],
|
|
@@ -730,15 +677,14 @@ var RULES = [
|
|
|
730
677
|
tools: [],
|
|
731
678
|
response: "TypeScript is a strongly typed programming language that builds on JavaScript."
|
|
732
679
|
},
|
|
733
|
-
// -------------------------------------------------------------------------
|
|
734
|
-
// Fallback
|
|
735
|
-
// -------------------------------------------------------------------------
|
|
736
680
|
{
|
|
737
681
|
match: /.*/,
|
|
738
682
|
tools: [],
|
|
739
683
|
response: "I understand. Let me help you with that."
|
|
740
684
|
}
|
|
741
685
|
];
|
|
686
|
+
|
|
687
|
+
// src/server/llm/mock.ts
|
|
742
688
|
function matchRule(prompt) {
|
|
743
689
|
for (const rule of RULES) {
|
|
744
690
|
const match = prompt.match(rule.match);
|
|
@@ -1898,19 +1844,19 @@ var LspServer = class {
|
|
|
1898
1844
|
*/
|
|
1899
1845
|
async getDiagnosticsWithWait(path, timeoutMs = DIAGNOSTIC_WAIT_MS) {
|
|
1900
1846
|
if (this.openDocuments.has(path)) {
|
|
1901
|
-
return new Promise((
|
|
1847
|
+
return new Promise((resolve4) => {
|
|
1902
1848
|
const existing = this.diagnostics.get(path);
|
|
1903
1849
|
if (existing !== void 0) {
|
|
1904
1850
|
setTimeout(() => {
|
|
1905
|
-
|
|
1851
|
+
resolve4(this.diagnostics.get(path) ?? []);
|
|
1906
1852
|
}, 100);
|
|
1907
1853
|
return;
|
|
1908
1854
|
}
|
|
1909
1855
|
const timeout = setTimeout(() => {
|
|
1910
1856
|
this.pendingDiagnostics.delete(path);
|
|
1911
|
-
|
|
1857
|
+
resolve4(this.diagnostics.get(path) ?? []);
|
|
1912
1858
|
}, timeoutMs);
|
|
1913
|
-
this.pendingDiagnostics.set(path, { resolve:
|
|
1859
|
+
this.pendingDiagnostics.set(path, { resolve: resolve4, timeout });
|
|
1914
1860
|
});
|
|
1915
1861
|
}
|
|
1916
1862
|
return this.diagnostics.get(path) ?? [];
|
|
@@ -1995,459 +1941,12 @@ async function which(command, workdir) {
|
|
|
1995
1941
|
|
|
1996
1942
|
// src/server/lsp/languages.ts
|
|
1997
1943
|
import { extname as extname2, basename } from "path";
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
serverCommand: "typescript-language-server",
|
|
2005
|
-
serverArgs: ["--stdio"],
|
|
2006
|
-
rootPatterns: ["tsconfig.json", "jsconfig.json", "package.json"],
|
|
2007
|
-
languageIds: {
|
|
2008
|
-
".ts": "typescript",
|
|
2009
|
-
".tsx": "typescriptreact",
|
|
2010
|
-
".js": "javascript",
|
|
2011
|
-
".jsx": "javascriptreact",
|
|
2012
|
-
".mjs": "javascript",
|
|
2013
|
-
".cjs": "javascript"
|
|
2014
|
-
}
|
|
2015
|
-
},
|
|
2016
|
-
// Python
|
|
2017
|
-
{
|
|
2018
|
-
id: "python",
|
|
2019
|
-
name: "Python",
|
|
2020
|
-
extensions: [".py", ".pyi", ".pyw"],
|
|
2021
|
-
serverCommand: "pyright-langserver",
|
|
2022
|
-
serverArgs: ["--stdio"],
|
|
2023
|
-
rootPatterns: ["pyproject.toml", "setup.py", "requirements.txt", "Pipfile"]
|
|
2024
|
-
},
|
|
2025
|
-
// Rust
|
|
2026
|
-
{
|
|
2027
|
-
id: "rust",
|
|
2028
|
-
name: "Rust",
|
|
2029
|
-
extensions: [".rs"],
|
|
2030
|
-
serverCommand: "rust-analyzer",
|
|
2031
|
-
serverArgs: [],
|
|
2032
|
-
rootPatterns: ["Cargo.toml"]
|
|
2033
|
-
},
|
|
2034
|
-
// Go
|
|
2035
|
-
{
|
|
2036
|
-
id: "go",
|
|
2037
|
-
name: "Go",
|
|
2038
|
-
extensions: [".go"],
|
|
2039
|
-
serverCommand: "gopls",
|
|
2040
|
-
serverArgs: ["serve"],
|
|
2041
|
-
rootPatterns: ["go.mod", "go.sum"]
|
|
2042
|
-
},
|
|
2043
|
-
// C/C++
|
|
2044
|
-
{
|
|
2045
|
-
id: "cpp",
|
|
2046
|
-
name: "C/C++",
|
|
2047
|
-
extensions: [".c", ".cpp", ".cc", ".cxx", ".h", ".hpp", ".hxx", ".hh"],
|
|
2048
|
-
serverCommand: "clangd",
|
|
2049
|
-
serverArgs: ["--background-index"],
|
|
2050
|
-
rootPatterns: ["compile_commands.json", "CMakeLists.txt", ".clangd", "Makefile"]
|
|
2051
|
-
},
|
|
2052
|
-
// Zig
|
|
2053
|
-
{
|
|
2054
|
-
id: "zig",
|
|
2055
|
-
name: "Zig",
|
|
2056
|
-
extensions: [".zig"],
|
|
2057
|
-
serverCommand: "zls",
|
|
2058
|
-
serverArgs: [],
|
|
2059
|
-
rootPatterns: ["build.zig", "build.zig.zon"]
|
|
2060
|
-
},
|
|
2061
|
-
// Lua
|
|
2062
|
-
{
|
|
2063
|
-
id: "lua",
|
|
2064
|
-
name: "Lua",
|
|
2065
|
-
extensions: [".lua"],
|
|
2066
|
-
serverCommand: "lua-language-server",
|
|
2067
|
-
serverArgs: [],
|
|
2068
|
-
rootPatterns: [".luarc.json", ".luarc.jsonc", ".luacheckrc"]
|
|
2069
|
-
},
|
|
2070
|
-
// Ruby
|
|
2071
|
-
{
|
|
2072
|
-
id: "ruby",
|
|
2073
|
-
name: "Ruby",
|
|
2074
|
-
extensions: [".rb", ".rake", ".gemspec"],
|
|
2075
|
-
serverCommand: "solargraph",
|
|
2076
|
-
serverArgs: ["stdio"],
|
|
2077
|
-
rootPatterns: ["Gemfile", ".ruby-version"]
|
|
2078
|
-
},
|
|
2079
|
-
// Elixir
|
|
2080
|
-
{
|
|
2081
|
-
id: "elixir",
|
|
2082
|
-
name: "Elixir",
|
|
2083
|
-
extensions: [".ex", ".exs"],
|
|
2084
|
-
serverCommand: "elixir-ls",
|
|
2085
|
-
serverArgs: [],
|
|
2086
|
-
rootPatterns: ["mix.exs"]
|
|
2087
|
-
},
|
|
2088
|
-
// Haskell
|
|
2089
|
-
{
|
|
2090
|
-
id: "haskell",
|
|
2091
|
-
name: "Haskell",
|
|
2092
|
-
extensions: [".hs", ".lhs"],
|
|
2093
|
-
serverCommand: "haskell-language-server-wrapper",
|
|
2094
|
-
serverArgs: ["--lsp"],
|
|
2095
|
-
rootPatterns: ["stack.yaml", "cabal.project", "*.cabal"]
|
|
2096
|
-
},
|
|
2097
|
-
// OCaml
|
|
2098
|
-
{
|
|
2099
|
-
id: "ocaml",
|
|
2100
|
-
name: "OCaml",
|
|
2101
|
-
extensions: [".ml", ".mli"],
|
|
2102
|
-
serverCommand: "ocamllsp",
|
|
2103
|
-
serverArgs: [],
|
|
2104
|
-
rootPatterns: ["dune-project", "dune", "*.opam"]
|
|
2105
|
-
},
|
|
2106
|
-
// Scala
|
|
2107
|
-
{
|
|
2108
|
-
id: "scala",
|
|
2109
|
-
name: "Scala",
|
|
2110
|
-
extensions: [".scala", ".sc"],
|
|
2111
|
-
serverCommand: "metals",
|
|
2112
|
-
serverArgs: [],
|
|
2113
|
-
rootPatterns: ["build.sbt", "build.sc", ".metals"]
|
|
2114
|
-
},
|
|
2115
|
-
// Kotlin
|
|
2116
|
-
{
|
|
2117
|
-
id: "kotlin",
|
|
2118
|
-
name: "Kotlin",
|
|
2119
|
-
extensions: [".kt", ".kts"],
|
|
2120
|
-
serverCommand: "kotlin-language-server",
|
|
2121
|
-
serverArgs: [],
|
|
2122
|
-
rootPatterns: ["build.gradle.kts", "build.gradle", "settings.gradle.kts"]
|
|
2123
|
-
},
|
|
2124
|
-
// Java
|
|
2125
|
-
{
|
|
2126
|
-
id: "java",
|
|
2127
|
-
name: "Java",
|
|
2128
|
-
extensions: [".java"],
|
|
2129
|
-
serverCommand: "jdtls",
|
|
2130
|
-
serverArgs: [],
|
|
2131
|
-
rootPatterns: ["pom.xml", "build.gradle", ".project"]
|
|
2132
|
-
},
|
|
2133
|
-
// C#
|
|
2134
|
-
{
|
|
2135
|
-
id: "csharp",
|
|
2136
|
-
name: "C#",
|
|
2137
|
-
extensions: [".cs", ".csx"],
|
|
2138
|
-
serverCommand: "OmniSharp",
|
|
2139
|
-
serverArgs: ["-lsp"],
|
|
2140
|
-
rootPatterns: ["*.csproj", "*.sln"]
|
|
2141
|
-
},
|
|
2142
|
-
// Swift
|
|
2143
|
-
{
|
|
2144
|
-
id: "swift",
|
|
2145
|
-
name: "Swift",
|
|
2146
|
-
extensions: [".swift"],
|
|
2147
|
-
serverCommand: "sourcekit-lsp",
|
|
2148
|
-
serverArgs: [],
|
|
2149
|
-
rootPatterns: ["Package.swift", "*.xcodeproj", "*.xcworkspace"]
|
|
2150
|
-
},
|
|
2151
|
-
// PHP
|
|
2152
|
-
{
|
|
2153
|
-
id: "php",
|
|
2154
|
-
name: "PHP",
|
|
2155
|
-
extensions: [".php", ".phtml"],
|
|
2156
|
-
serverCommand: "phpactor",
|
|
2157
|
-
serverArgs: ["language-server"],
|
|
2158
|
-
rootPatterns: ["composer.json", "phpunit.xml"]
|
|
2159
|
-
},
|
|
2160
|
-
// YAML
|
|
2161
|
-
{
|
|
2162
|
-
id: "yaml",
|
|
2163
|
-
name: "YAML",
|
|
2164
|
-
extensions: [".yaml", ".yml"],
|
|
2165
|
-
serverCommand: "yaml-language-server",
|
|
2166
|
-
serverArgs: ["--stdio"],
|
|
2167
|
-
rootPatterns: []
|
|
2168
|
-
},
|
|
2169
|
-
// JSON
|
|
2170
|
-
{
|
|
2171
|
-
id: "json",
|
|
2172
|
-
name: "JSON",
|
|
2173
|
-
extensions: [".json", ".jsonc"],
|
|
2174
|
-
serverCommand: "vscode-json-language-server",
|
|
2175
|
-
serverArgs: ["--stdio"],
|
|
2176
|
-
rootPatterns: []
|
|
2177
|
-
},
|
|
2178
|
-
// HTML
|
|
2179
|
-
{
|
|
2180
|
-
id: "html",
|
|
2181
|
-
name: "HTML",
|
|
2182
|
-
extensions: [".html", ".htm", ".xhtml"],
|
|
2183
|
-
serverCommand: "vscode-html-language-server",
|
|
2184
|
-
serverArgs: ["--stdio"],
|
|
2185
|
-
rootPatterns: []
|
|
2186
|
-
},
|
|
2187
|
-
// CSS
|
|
2188
|
-
{
|
|
2189
|
-
id: "css",
|
|
2190
|
-
name: "CSS",
|
|
2191
|
-
extensions: [".css", ".scss", ".sass", ".less"],
|
|
2192
|
-
serverCommand: "vscode-css-language-server",
|
|
2193
|
-
serverArgs: ["--stdio"],
|
|
2194
|
-
rootPatterns: []
|
|
2195
|
-
},
|
|
2196
|
-
// Vue
|
|
2197
|
-
{
|
|
2198
|
-
id: "vue",
|
|
2199
|
-
name: "Vue",
|
|
2200
|
-
extensions: [".vue"],
|
|
2201
|
-
serverCommand: "vue-language-server",
|
|
2202
|
-
serverArgs: ["--stdio"],
|
|
2203
|
-
rootPatterns: ["vite.config.ts", "vite.config.js", "vue.config.js"]
|
|
2204
|
-
},
|
|
2205
|
-
// Svelte
|
|
2206
|
-
{
|
|
2207
|
-
id: "svelte",
|
|
2208
|
-
name: "Svelte",
|
|
2209
|
-
extensions: [".svelte"],
|
|
2210
|
-
serverCommand: "svelteserver",
|
|
2211
|
-
serverArgs: ["--stdio"],
|
|
2212
|
-
rootPatterns: ["svelte.config.js", "svelte.config.ts"]
|
|
2213
|
-
},
|
|
2214
|
-
// Terraform
|
|
2215
|
-
{
|
|
2216
|
-
id: "terraform",
|
|
2217
|
-
name: "Terraform",
|
|
2218
|
-
extensions: [".tf", ".tfvars"],
|
|
2219
|
-
serverCommand: "terraform-ls",
|
|
2220
|
-
serverArgs: ["serve"],
|
|
2221
|
-
rootPatterns: [".terraform", "main.tf"]
|
|
2222
|
-
},
|
|
2223
|
-
// Dockerfile
|
|
2224
|
-
{
|
|
2225
|
-
id: "dockerfile",
|
|
2226
|
-
name: "Docker",
|
|
2227
|
-
extensions: [],
|
|
2228
|
-
// Uses filename matching
|
|
2229
|
-
serverCommand: "docker-langserver",
|
|
2230
|
-
serverArgs: ["--stdio"],
|
|
2231
|
-
rootPatterns: ["Dockerfile", "docker-compose.yml"]
|
|
2232
|
-
},
|
|
2233
|
-
// Bash/Shell
|
|
2234
|
-
{
|
|
2235
|
-
id: "bash",
|
|
2236
|
-
name: "Bash",
|
|
2237
|
-
extensions: [".sh", ".bash", ".zsh"],
|
|
2238
|
-
serverCommand: "bash-language-server",
|
|
2239
|
-
serverArgs: ["start"],
|
|
2240
|
-
rootPatterns: []
|
|
2241
|
-
},
|
|
2242
|
-
// SQL
|
|
2243
|
-
{
|
|
2244
|
-
id: "sql",
|
|
2245
|
-
name: "SQL",
|
|
2246
|
-
extensions: [".sql"],
|
|
2247
|
-
serverCommand: "sql-language-server",
|
|
2248
|
-
serverArgs: ["up", "--method", "stdio"],
|
|
2249
|
-
rootPatterns: [],
|
|
2250
|
-
installHint: "npm install -g sql-language-server"
|
|
2251
|
-
},
|
|
2252
|
-
// GraphQL
|
|
2253
|
-
{
|
|
2254
|
-
id: "graphql",
|
|
2255
|
-
name: "GraphQL",
|
|
2256
|
-
extensions: [".graphql", ".gql"],
|
|
2257
|
-
serverCommand: "graphql-lsp",
|
|
2258
|
-
serverArgs: ["server", "-m", "stream"],
|
|
2259
|
-
rootPatterns: [".graphqlrc", ".graphqlrc.yml", ".graphqlrc.json", "graphql.config.js"]
|
|
2260
|
-
},
|
|
2261
|
-
// Nix
|
|
2262
|
-
{
|
|
2263
|
-
id: "nix",
|
|
2264
|
-
name: "Nix",
|
|
2265
|
-
extensions: [".nix"],
|
|
2266
|
-
serverCommand: "nil",
|
|
2267
|
-
serverArgs: [],
|
|
2268
|
-
rootPatterns: ["flake.nix", "default.nix", "shell.nix"]
|
|
2269
|
-
},
|
|
2270
|
-
// Gleam
|
|
2271
|
-
{
|
|
2272
|
-
id: "gleam",
|
|
2273
|
-
name: "Gleam",
|
|
2274
|
-
extensions: [".gleam"],
|
|
2275
|
-
serverCommand: "gleam",
|
|
2276
|
-
serverArgs: ["lsp"],
|
|
2277
|
-
rootPatterns: ["gleam.toml"]
|
|
2278
|
-
},
|
|
2279
|
-
// Elm
|
|
2280
|
-
{
|
|
2281
|
-
id: "elm",
|
|
2282
|
-
name: "Elm",
|
|
2283
|
-
extensions: [".elm"],
|
|
2284
|
-
serverCommand: "elm-language-server",
|
|
2285
|
-
serverArgs: [],
|
|
2286
|
-
rootPatterns: ["elm.json"]
|
|
2287
|
-
},
|
|
2288
|
-
// Dart
|
|
2289
|
-
{
|
|
2290
|
-
id: "dart",
|
|
2291
|
-
name: "Dart",
|
|
2292
|
-
extensions: [".dart"],
|
|
2293
|
-
serverCommand: "dart",
|
|
2294
|
-
serverArgs: ["language-server", "--protocol=lsp"],
|
|
2295
|
-
rootPatterns: ["pubspec.yaml"]
|
|
2296
|
-
},
|
|
2297
|
-
// Julia
|
|
2298
|
-
{
|
|
2299
|
-
id: "julia",
|
|
2300
|
-
name: "Julia",
|
|
2301
|
-
extensions: [".jl"],
|
|
2302
|
-
serverCommand: "julia",
|
|
2303
|
-
serverArgs: ["--startup-file=no", "--history-file=no", "-e", "using LanguageServer; runserver()"],
|
|
2304
|
-
rootPatterns: ["Project.toml"]
|
|
2305
|
-
},
|
|
2306
|
-
// R
|
|
2307
|
-
{
|
|
2308
|
-
id: "r",
|
|
2309
|
-
name: "R",
|
|
2310
|
-
extensions: [".r", ".R", ".rmd", ".Rmd"],
|
|
2311
|
-
serverCommand: "R",
|
|
2312
|
-
serverArgs: ["--slave", "-e", "languageserver::run()"],
|
|
2313
|
-
rootPatterns: ["DESCRIPTION", ".Rproj"]
|
|
2314
|
-
},
|
|
2315
|
-
// Clojure
|
|
2316
|
-
{
|
|
2317
|
-
id: "clojure",
|
|
2318
|
-
name: "Clojure",
|
|
2319
|
-
extensions: [".clj", ".cljs", ".cljc", ".edn"],
|
|
2320
|
-
serverCommand: "clojure-lsp",
|
|
2321
|
-
serverArgs: [],
|
|
2322
|
-
rootPatterns: ["deps.edn", "project.clj", "shadow-cljs.edn"]
|
|
2323
|
-
},
|
|
2324
|
-
// Nim
|
|
2325
|
-
{
|
|
2326
|
-
id: "nim",
|
|
2327
|
-
name: "Nim",
|
|
2328
|
-
extensions: [".nim", ".nims"],
|
|
2329
|
-
serverCommand: "nimlsp",
|
|
2330
|
-
serverArgs: [],
|
|
2331
|
-
rootPatterns: ["*.nimble"]
|
|
2332
|
-
},
|
|
2333
|
-
// V
|
|
2334
|
-
{
|
|
2335
|
-
id: "vlang",
|
|
2336
|
-
name: "V",
|
|
2337
|
-
extensions: [".v", ".vv"],
|
|
2338
|
-
serverCommand: "vls",
|
|
2339
|
-
serverArgs: [],
|
|
2340
|
-
rootPatterns: ["v.mod"]
|
|
2341
|
-
},
|
|
2342
|
-
// Crystal
|
|
2343
|
-
{
|
|
2344
|
-
id: "crystal",
|
|
2345
|
-
name: "Crystal",
|
|
2346
|
-
extensions: [".cr"],
|
|
2347
|
-
serverCommand: "crystalline",
|
|
2348
|
-
serverArgs: [],
|
|
2349
|
-
rootPatterns: ["shard.yml"]
|
|
2350
|
-
},
|
|
2351
|
-
// D
|
|
2352
|
-
{
|
|
2353
|
-
id: "d",
|
|
2354
|
-
name: "D",
|
|
2355
|
-
extensions: [".d"],
|
|
2356
|
-
serverCommand: "serve-d",
|
|
2357
|
-
serverArgs: [],
|
|
2358
|
-
rootPatterns: ["dub.json", "dub.sdl"]
|
|
2359
|
-
},
|
|
2360
|
-
// Erlang
|
|
2361
|
-
{
|
|
2362
|
-
id: "erlang",
|
|
2363
|
-
name: "Erlang",
|
|
2364
|
-
extensions: [".erl", ".hrl"],
|
|
2365
|
-
serverCommand: "erlang_ls",
|
|
2366
|
-
serverArgs: [],
|
|
2367
|
-
rootPatterns: ["rebar.config", "erlang.mk"]
|
|
2368
|
-
},
|
|
2369
|
-
// F#
|
|
2370
|
-
{
|
|
2371
|
-
id: "fsharp",
|
|
2372
|
-
name: "F#",
|
|
2373
|
-
extensions: [".fs", ".fsx", ".fsi"],
|
|
2374
|
-
serverCommand: "fsautocomplete",
|
|
2375
|
-
serverArgs: ["--adaptive-lsp-server-enabled"],
|
|
2376
|
-
rootPatterns: ["*.fsproj"]
|
|
2377
|
-
},
|
|
2378
|
-
// Fortran
|
|
2379
|
-
{
|
|
2380
|
-
id: "fortran",
|
|
2381
|
-
name: "Fortran",
|
|
2382
|
-
extensions: [".f", ".f90", ".f95", ".f03", ".f08"],
|
|
2383
|
-
serverCommand: "fortls",
|
|
2384
|
-
serverArgs: [],
|
|
2385
|
-
rootPatterns: []
|
|
2386
|
-
},
|
|
2387
|
-
// LaTeX
|
|
2388
|
-
{
|
|
2389
|
-
id: "latex",
|
|
2390
|
-
name: "LaTeX",
|
|
2391
|
-
extensions: [".tex", ".bib"],
|
|
2392
|
-
serverCommand: "texlab",
|
|
2393
|
-
serverArgs: [],
|
|
2394
|
-
rootPatterns: ["*.tex"]
|
|
2395
|
-
},
|
|
2396
|
-
// Markdown
|
|
2397
|
-
{
|
|
2398
|
-
id: "markdown",
|
|
2399
|
-
name: "Markdown",
|
|
2400
|
-
extensions: [".md", ".markdown"],
|
|
2401
|
-
serverCommand: "marksman",
|
|
2402
|
-
serverArgs: [],
|
|
2403
|
-
rootPatterns: []
|
|
2404
|
-
},
|
|
2405
|
-
// TOML
|
|
2406
|
-
{
|
|
2407
|
-
id: "toml",
|
|
2408
|
-
name: "TOML",
|
|
2409
|
-
extensions: [".toml"],
|
|
2410
|
-
serverCommand: "taplo",
|
|
2411
|
-
serverArgs: ["lsp", "stdio"],
|
|
2412
|
-
rootPatterns: []
|
|
2413
|
-
},
|
|
2414
|
-
// Protobuf
|
|
2415
|
-
{
|
|
2416
|
-
id: "protobuf",
|
|
2417
|
-
name: "Protocol Buffers",
|
|
2418
|
-
extensions: [".proto"],
|
|
2419
|
-
serverCommand: "bufls",
|
|
2420
|
-
serverArgs: ["serve"],
|
|
2421
|
-
rootPatterns: ["buf.yaml", "buf.gen.yaml"]
|
|
2422
|
-
},
|
|
2423
|
-
// Assembly (various)
|
|
2424
|
-
{
|
|
2425
|
-
id: "asm",
|
|
2426
|
-
name: "Assembly",
|
|
2427
|
-
extensions: [".asm", ".s", ".S"],
|
|
2428
|
-
serverCommand: "asm-lsp",
|
|
2429
|
-
serverArgs: [],
|
|
2430
|
-
rootPatterns: []
|
|
2431
|
-
},
|
|
2432
|
-
// CMake
|
|
2433
|
-
{
|
|
2434
|
-
id: "cmake",
|
|
2435
|
-
name: "CMake",
|
|
2436
|
-
extensions: [".cmake"],
|
|
2437
|
-
serverCommand: "cmake-language-server",
|
|
2438
|
-
serverArgs: [],
|
|
2439
|
-
rootPatterns: ["CMakeLists.txt"]
|
|
2440
|
-
},
|
|
2441
|
-
// Perl
|
|
2442
|
-
{
|
|
2443
|
-
id: "perl",
|
|
2444
|
-
name: "Perl",
|
|
2445
|
-
extensions: [".pl", ".pm"],
|
|
2446
|
-
serverCommand: "pls",
|
|
2447
|
-
serverArgs: [],
|
|
2448
|
-
rootPatterns: ["cpanfile", "Makefile.PL"]
|
|
2449
|
-
}
|
|
2450
|
-
];
|
|
1944
|
+
import { readFileSync } from "fs";
|
|
1945
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1946
|
+
import { dirname as dirname2, resolve } from "path";
|
|
1947
|
+
var __dirname2 = dirname2(fileURLToPath2(import.meta.url));
|
|
1948
|
+
var languagesJson = JSON.parse(readFileSync(resolve(__dirname2, "languages.json"), "utf-8"));
|
|
1949
|
+
var LANGUAGES = languagesJson;
|
|
2451
1950
|
var extensionToLanguage = /* @__PURE__ */ new Map();
|
|
2452
1951
|
for (const lang of LANGUAGES) {
|
|
2453
1952
|
for (const ext of lang.extensions) {
|
|
@@ -3583,10 +3082,10 @@ function createSkillRoutes(configDir, projectDir) {
|
|
|
3583
3082
|
|
|
3584
3083
|
// src/server/commands/registry.ts
|
|
3585
3084
|
import { writeFile, mkdir, unlink } from "fs/promises";
|
|
3586
|
-
import { join as join3, dirname as
|
|
3587
|
-
import { fileURLToPath as
|
|
3085
|
+
import { join as join3, dirname as dirname3 } from "path";
|
|
3086
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
3588
3087
|
import matter from "gray-matter";
|
|
3589
|
-
var __bundleDir =
|
|
3088
|
+
var __bundleDir = dirname3(fileURLToPath3(import.meta.url));
|
|
3590
3089
|
var DEFAULTS_DIR = join3(__bundleDir, "defaults");
|
|
3591
3090
|
var DEFAULTS_DIR_ALT = join3(__bundleDir, "command-defaults");
|
|
3592
3091
|
var COMMAND_EXTENSION = ".command.md";
|
|
@@ -3905,20 +3404,20 @@ function createTerminalRoutes() {
|
|
|
3905
3404
|
// src/server/routes/directories.ts
|
|
3906
3405
|
import { Router as Router5 } from "express";
|
|
3907
3406
|
import { readdir } from "fs/promises";
|
|
3908
|
-
import { resolve, join as join4, dirname as
|
|
3407
|
+
import { resolve as resolve2, join as join4, dirname as dirname4, basename as basename2 } from "path";
|
|
3909
3408
|
function createDirectoryRoutes() {
|
|
3910
3409
|
const router = Router5();
|
|
3911
3410
|
const DEFAULT_BASE_PATH = process.cwd();
|
|
3912
3411
|
router.get("/", async (req, res) => {
|
|
3913
3412
|
const path = req.query["path"] || DEFAULT_BASE_PATH;
|
|
3914
3413
|
try {
|
|
3915
|
-
const resolvedPath =
|
|
3414
|
+
const resolvedPath = resolve2(path);
|
|
3916
3415
|
const entries = await readdir(resolvedPath, { withFileTypes: true });
|
|
3917
3416
|
const directories = entries.filter((entry) => entry.isDirectory()).map((entry) => ({
|
|
3918
3417
|
name: entry.name,
|
|
3919
3418
|
path: join4(resolvedPath, entry.name)
|
|
3920
3419
|
})).sort((a, b) => a.name.localeCompare(b.name));
|
|
3921
|
-
const parent =
|
|
3420
|
+
const parent = dirname4(resolvedPath);
|
|
3922
3421
|
const hasParent = parent !== resolvedPath;
|
|
3923
3422
|
res.json({
|
|
3924
3423
|
current: resolvedPath,
|
|
@@ -3944,7 +3443,7 @@ import { Router as Router6 } from "express";
|
|
|
3944
3443
|
import { spawn as spawn2 } from "child_process";
|
|
3945
3444
|
|
|
3946
3445
|
// src/constants.ts
|
|
3947
|
-
var VERSION = "2.0.
|
|
3446
|
+
var VERSION = "2.0.20";
|
|
3948
3447
|
|
|
3949
3448
|
// src/server/routes/auto-update.ts
|
|
3950
3449
|
var updateInProgress = false;
|
|
@@ -3967,7 +3466,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
3967
3466
|
const isService = isRunningAsService();
|
|
3968
3467
|
const current = VERSION;
|
|
3969
3468
|
try {
|
|
3970
|
-
const latest = await new Promise((
|
|
3469
|
+
const latest = await new Promise((resolve4, reject) => {
|
|
3971
3470
|
const child = spawn2("npm", ["view", "openfox", "version"], {
|
|
3972
3471
|
stdio: ["ignore", "pipe", "pipe"]
|
|
3973
3472
|
});
|
|
@@ -3977,7 +3476,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
3977
3476
|
});
|
|
3978
3477
|
child.on("close", (code) => {
|
|
3979
3478
|
if (code === 0) {
|
|
3980
|
-
|
|
3479
|
+
resolve4(stdout.trim());
|
|
3981
3480
|
} else {
|
|
3982
3481
|
reject(new Error(`npm view exited with code ${code}`));
|
|
3983
3482
|
}
|
|
@@ -4020,9 +3519,9 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
4020
3519
|
const timeout = setTimeout(() => {
|
|
4021
3520
|
child.kill();
|
|
4022
3521
|
}, UPDATE_TIMEOUT);
|
|
4023
|
-
const exitCode = await new Promise((
|
|
4024
|
-
child.on("close",
|
|
4025
|
-
child.on("error", () =>
|
|
3522
|
+
const exitCode = await new Promise((resolve4) => {
|
|
3523
|
+
child.on("close", resolve4);
|
|
3524
|
+
child.on("error", () => resolve4(1));
|
|
4026
3525
|
});
|
|
4027
3526
|
clearTimeout(timeout);
|
|
4028
3527
|
if (exitCode === 0) {
|
|
@@ -4059,7 +3558,7 @@ function createAutoUpdateRoutes(options = {}) {
|
|
|
4059
3558
|
}
|
|
4060
3559
|
|
|
4061
3560
|
// src/server/index.ts
|
|
4062
|
-
var
|
|
3561
|
+
var __dirname3 = dirname5(fileURLToPath4(import.meta.url));
|
|
4063
3562
|
async function createServerHandle(config4) {
|
|
4064
3563
|
setRuntimeConfig(config4);
|
|
4065
3564
|
setLogLevel(config4.logging?.level ?? void 0, config4.mode);
|
|
@@ -4124,7 +3623,7 @@ async function createServerHandle(config4) {
|
|
|
4124
3623
|
setMcpTools(mcpTools);
|
|
4125
3624
|
logger.info("MCP tools registered", { count: mcpTools.length });
|
|
4126
3625
|
}
|
|
4127
|
-
const { signalMcpReady } = await import("./server-
|
|
3626
|
+
const { signalMcpReady } = await import("./server-CN7ML6XN.js");
|
|
4128
3627
|
signalMcpReady();
|
|
4129
3628
|
});
|
|
4130
3629
|
const app = express();
|
|
@@ -4179,7 +3678,9 @@ async function createServerHandle(config4) {
|
|
|
4179
3678
|
app.get("/api/tools", (_req, res) => {
|
|
4180
3679
|
const tools = toolRegistry.tools.map((t) => ({
|
|
4181
3680
|
name: t.name,
|
|
4182
|
-
actions: t.permittedActions || []
|
|
3681
|
+
actions: t.permittedActions || [],
|
|
3682
|
+
alwaysAllowed: ALWAYS_ALLOWED.has(t.name) || ALWAYS_ALLOWED_FOR_SUBAGENTS.has(t.name),
|
|
3683
|
+
topLevelOnly: TOP_LEVEL_ONLY_TOOLS.has(t.name)
|
|
4183
3684
|
}));
|
|
4184
3685
|
res.json({ tools });
|
|
4185
3686
|
});
|
|
@@ -4280,7 +3781,7 @@ async function createServerHandle(config4) {
|
|
|
4280
3781
|
res.json({ project });
|
|
4281
3782
|
});
|
|
4282
3783
|
app.get("/api/sessions", async (req, res) => {
|
|
4283
|
-
const { getRecentUserPromptsForSession } = await import("./events-
|
|
3784
|
+
const { getRecentUserPromptsForSession } = await import("./events-JKPHAR5W.js");
|
|
4284
3785
|
const projectId = req.query["projectId"];
|
|
4285
3786
|
const limit = Math.min(parseInt(req.query["limit"]) || 20, 100);
|
|
4286
3787
|
const offset = parseInt(req.query["offset"]) || 0;
|
|
@@ -4313,9 +3814,9 @@ async function createServerHandle(config4) {
|
|
|
4313
3814
|
res.status(201).json({ session });
|
|
4314
3815
|
});
|
|
4315
3816
|
app.get("/api/sessions/:id", async (req, res) => {
|
|
4316
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
4317
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
4318
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
3817
|
+
const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
|
|
3818
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
3819
|
+
const { getPendingQuestionsForSession } = await import("./tools-ZUOBYTVD.js");
|
|
4319
3820
|
const session = sessionManager.getSession(req.params.id);
|
|
4320
3821
|
if (!session) {
|
|
4321
3822
|
return res.status(404).json({ error: "Session not found" });
|
|
@@ -4346,8 +3847,8 @@ async function createServerHandle(config4) {
|
|
|
4346
3847
|
res.json({ success: true });
|
|
4347
3848
|
});
|
|
4348
3849
|
app.post("/api/sessions/:id/provider", async (req, res) => {
|
|
4349
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
4350
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
3850
|
+
const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
|
|
3851
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
4351
3852
|
const sessionId = req.params.id;
|
|
4352
3853
|
const session = sessionManager.getSession(sessionId);
|
|
4353
3854
|
if (!session) {
|
|
@@ -4389,8 +3890,8 @@ async function createServerHandle(config4) {
|
|
|
4389
3890
|
res.json({ success: true });
|
|
4390
3891
|
});
|
|
4391
3892
|
app.put("/api/sessions/:id/mode", async (req, res) => {
|
|
4392
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
4393
|
-
const { buildMessagesFromStoredEvents } = await import("./folding-
|
|
3893
|
+
const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
|
|
3894
|
+
const { buildMessagesFromStoredEvents } = await import("./folding-PI67HWBR.js");
|
|
4394
3895
|
const sessionId = req.params.id;
|
|
4395
3896
|
const session = sessionManager.getSession(sessionId);
|
|
4396
3897
|
if (!session) {
|
|
@@ -4446,15 +3947,15 @@ async function createServerHandle(config4) {
|
|
|
4446
3947
|
if (!callId || approved === void 0) {
|
|
4447
3948
|
return res.status(400).json({ error: "callId and approved are required" });
|
|
4448
3949
|
}
|
|
4449
|
-
const { providePathConfirmation } = await import("./tools-
|
|
3950
|
+
const { providePathConfirmation } = await import("./tools-ZUOBYTVD.js");
|
|
4450
3951
|
const result = providePathConfirmation(callId, approved, alwaysAllow);
|
|
4451
3952
|
if (!result.found) {
|
|
4452
3953
|
return res.status(404).json({ error: "No pending path confirmation with that ID" });
|
|
4453
3954
|
}
|
|
4454
|
-
const { getEventStore: getEventStore2 } = await import("./events-
|
|
4455
|
-
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-
|
|
3955
|
+
const { getEventStore: getEventStore2 } = await import("./events-JKPHAR5W.js");
|
|
3956
|
+
const { buildMessagesFromStoredEvents, foldPendingConfirmations } = await import("./folding-PI67HWBR.js");
|
|
4456
3957
|
const { createSessionStateMessage } = await import("./protocol-BKNLAEPJ.js");
|
|
4457
|
-
const { getPendingQuestionsForSession } = await import("./tools-
|
|
3958
|
+
const { getPendingQuestionsForSession } = await import("./tools-ZUOBYTVD.js");
|
|
4458
3959
|
const eventStore = getEventStore2();
|
|
4459
3960
|
const events = eventStore.getEvents(sessionId);
|
|
4460
3961
|
const messages = buildMessagesFromStoredEvents(events);
|
|
@@ -4475,7 +3976,7 @@ async function createServerHandle(config4) {
|
|
|
4475
3976
|
if (!skip && typeof answer !== "string") {
|
|
4476
3977
|
return res.status(400).json({ error: "answer is required when not skipping" });
|
|
4477
3978
|
}
|
|
4478
|
-
const { provideAnswer } = await import("./tools-
|
|
3979
|
+
const { provideAnswer } = await import("./tools-ZUOBYTVD.js");
|
|
4479
3980
|
const found = provideAnswer(callId, answer ?? "", skip ?? false);
|
|
4480
3981
|
if (!found) {
|
|
4481
3982
|
return res.status(404).json({ error: "No pending question with that ID" });
|
|
@@ -4511,15 +4012,15 @@ async function createServerHandle(config4) {
|
|
|
4511
4012
|
if (!session) {
|
|
4512
4013
|
return res.status(404).json({ error: "Session not found" });
|
|
4513
4014
|
}
|
|
4514
|
-
const { stopSessionExecution } = await import("./chat-handler-
|
|
4515
|
-
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-
|
|
4015
|
+
const { stopSessionExecution } = await import("./chat-handler-KNDSH5WR.js");
|
|
4016
|
+
const { cancelQuestionsForSession, cancelPathConfirmationsForSession } = await import("./tools-ZUOBYTVD.js");
|
|
4516
4017
|
const queuedMessages = sessionManager.getQueueState(sessionId);
|
|
4517
4018
|
sessionManager.clearMessageQueue(sessionId);
|
|
4518
4019
|
stopSessionExecution(sessionId, sessionManager);
|
|
4519
4020
|
abortSession(sessionId);
|
|
4520
4021
|
cancelQuestionsForSession(sessionId, "Session stopped by user");
|
|
4521
4022
|
cancelPathConfirmationsForSession(sessionId, "Session stopped by user");
|
|
4522
|
-
const eventStore = (await import("./events-
|
|
4023
|
+
const eventStore = (await import("./events-JKPHAR5W.js")).getEventStore();
|
|
4523
4024
|
eventStore.append(sessionId, { type: "running.changed", data: { isRunning: false } });
|
|
4524
4025
|
res.json({ success: true, queuedMessages });
|
|
4525
4026
|
});
|
|
@@ -4533,7 +4034,7 @@ async function createServerHandle(config4) {
|
|
|
4533
4034
|
if (typeof messageIndex !== "number" || messageIndex < 0) {
|
|
4534
4035
|
return res.status(400).json({ error: "messageIndex must be a non-negative number" });
|
|
4535
4036
|
}
|
|
4536
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4037
|
+
const { truncateSessionMessages } = await import("./events-JKPHAR5W.js");
|
|
4537
4038
|
truncateSessionMessages(sessionId, messageIndex);
|
|
4538
4039
|
res.json({ success: true });
|
|
4539
4040
|
});
|
|
@@ -4551,7 +4052,7 @@ async function createServerHandle(config4) {
|
|
|
4551
4052
|
if (!msg) {
|
|
4552
4053
|
return res.status(400).json({ error: "Message not found at this index" });
|
|
4553
4054
|
}
|
|
4554
|
-
const { truncateSessionMessages } = await import("./events-
|
|
4055
|
+
const { truncateSessionMessages } = await import("./events-JKPHAR5W.js");
|
|
4555
4056
|
truncateSessionMessages(sessionId, messageIndex - 1);
|
|
4556
4057
|
sessionManager.queueMessage(sessionId, "asap", msg.content, msg.attachments, msg.messageKind);
|
|
4557
4058
|
res.json({ success: true });
|
|
@@ -4955,7 +4456,7 @@ async function createServerHandle(config4) {
|
|
|
4955
4456
|
});
|
|
4956
4457
|
async function rebuildMcpTools() {
|
|
4957
4458
|
const { createMcpTools: createMcpTools2 } = await import("./tool-adapter-B7QP6NLA.js");
|
|
4958
|
-
const { setMcpTools: setMcpTools2 } = await import("./tools-
|
|
4459
|
+
const { setMcpTools: setMcpTools2 } = await import("./tools-ZUOBYTVD.js");
|
|
4959
4460
|
const mcpTools = createMcpTools2(mcpManager);
|
|
4960
4461
|
setMcpTools2(mcpTools);
|
|
4961
4462
|
}
|
|
@@ -5139,14 +4640,14 @@ async function createServerHandle(config4) {
|
|
|
5139
4640
|
await getCurrentBranch(req, res);
|
|
5140
4641
|
});
|
|
5141
4642
|
app.use("/api/directories", createDirectoryRoutes());
|
|
5142
|
-
const webDir =
|
|
4643
|
+
const webDir = resolve3(__dirname3, "../../web");
|
|
5143
4644
|
const isDev = config4.mode === "development";
|
|
5144
4645
|
let viteServer;
|
|
5145
4646
|
if (isDev) {
|
|
5146
4647
|
logger.info("Dev mode: using Vite middleware");
|
|
5147
4648
|
viteServer = await createViteServer({
|
|
5148
4649
|
root: webDir,
|
|
5149
|
-
configFile:
|
|
4650
|
+
configFile: resolve3(__dirname3, "../../web/vite.config.ts"),
|
|
5150
4651
|
server: { middlewareMode: true },
|
|
5151
4652
|
appType: "spa",
|
|
5152
4653
|
logLevel: "warn"
|
|
@@ -5198,7 +4699,7 @@ async function createServerHandle(config4) {
|
|
|
5198
4699
|
logger.info("Vite middleware ready", { port: config4.server.port });
|
|
5199
4700
|
}
|
|
5200
4701
|
if (!isDev) {
|
|
5201
|
-
const distWebDir =
|
|
4702
|
+
const distWebDir = resolve3(__dirname3, "web");
|
|
5202
4703
|
app.use(
|
|
5203
4704
|
"/assets",
|
|
5204
4705
|
express.static(join5(distWebDir, "assets"), {
|
|
@@ -5267,7 +4768,7 @@ async function createServerHandle(config4) {
|
|
|
5267
4768
|
const state = sessionManager.getContextState(sessionId);
|
|
5268
4769
|
wssExports.broadcastForSession(sessionId, createContextStateMessage(state));
|
|
5269
4770
|
});
|
|
5270
|
-
const { QueueProcessor } = await import("./processor-
|
|
4771
|
+
const { QueueProcessor } = await import("./processor-DKAYI3PV.js");
|
|
5271
4772
|
const queueProcessor = new QueueProcessor({
|
|
5272
4773
|
sessionManager,
|
|
5273
4774
|
providerManager,
|
|
@@ -5289,7 +4790,7 @@ async function createServerHandle(config4) {
|
|
|
5289
4790
|
return {
|
|
5290
4791
|
httpServer,
|
|
5291
4792
|
ctx: { config: config4, sessionManager, llmClient: getLLMClient(), toolRegistry, providerManager },
|
|
5292
|
-
start: (port) => new Promise((
|
|
4793
|
+
start: (port) => new Promise((resolve4, reject) => {
|
|
5293
4794
|
const listenPort = port ?? config4.server.port;
|
|
5294
4795
|
const host = config4.server.host;
|
|
5295
4796
|
httpServer.listen(listenPort, host, () => {
|
|
@@ -5299,11 +4800,11 @@ async function createServerHandle(config4) {
|
|
|
5299
4800
|
logger.info(`OpenFox server running at http://${host}:${actualPort}`);
|
|
5300
4801
|
logger.info(`WebSocket available at ws://${host}:${actualPort}/ws`);
|
|
5301
4802
|
logger.info(`LLM backend: ${client.getBackend()}, model: ${client.getModel()}, url: ${config4.llm.baseUrl}`);
|
|
5302
|
-
|
|
4803
|
+
resolve4({ port: actualPort });
|
|
5303
4804
|
});
|
|
5304
4805
|
httpServer.on("error", reject);
|
|
5305
4806
|
}),
|
|
5306
|
-
close: () => new Promise((
|
|
4807
|
+
close: () => new Promise((resolve4) => {
|
|
5307
4808
|
logger.info("Shutting down...");
|
|
5308
4809
|
void (async () => {
|
|
5309
4810
|
await devServerManager.stopAll();
|
|
@@ -5317,7 +4818,7 @@ async function createServerHandle(config4) {
|
|
|
5317
4818
|
client.terminate();
|
|
5318
4819
|
}
|
|
5319
4820
|
wss.close();
|
|
5320
|
-
httpServer.close(() =>
|
|
4821
|
+
httpServer.close(() => resolve4());
|
|
5321
4822
|
})();
|
|
5322
4823
|
})
|
|
5323
4824
|
};
|
|
@@ -5342,4 +4843,4 @@ export {
|
|
|
5342
4843
|
createServerHandle,
|
|
5343
4844
|
createServer
|
|
5344
4845
|
};
|
|
5345
|
-
//# sourceMappingURL=chunk-
|
|
4846
|
+
//# sourceMappingURL=chunk-3QQ4QKAU.js.map
|