dorkos 0.31.0 → 0.33.0
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/bin/cli.js +22 -14
- package/dist/client/assets/{TopologyGraph-D40rtjiX.js → TopologyGraph-CcPsezRc.js} +1 -1
- package/dist/client/assets/{highlighted-body-OFNGDK62-CBGtM5Ui.js → highlighted-body-OFNGDK62-D7oYf2hk.js} +1 -1
- package/dist/client/assets/{index-CDiTLqeC.js → index-BihWaFja.js} +1 -1
- package/dist/client/assets/index-CEFjTlQX.css +1 -0
- package/dist/client/assets/{index-ChWLyxbP.js → index-CHbFiiOd.js} +1 -1
- package/dist/client/assets/index-DyrjYQ0i.js +1113 -0
- package/dist/client/index.html +2 -2
- package/dist/server/index.js +304 -167
- package/dist/server/index.js.map +4 -4
- package/package.json +2 -2
- package/dist/client/assets/TopologyGraph-YjSpORAp.js +0 -40
- package/dist/client/assets/highlighted-body-OFNGDK62-FmdGSHPA.js +0 -1
- package/dist/client/assets/index-BKQDXBuS.css +0 -1
- package/dist/client/assets/index-DLrymlpV.js +0 -1
- package/dist/client/assets/index-DZWy2W_p.js +0 -69
- package/dist/client/assets/index-Dvb_t9KD.js +0 -1098
- package/dist/client/assets/index-KOXD1Zj-.js +0 -1098
package/dist/server/index.js
CHANGED
|
@@ -21843,6 +21843,47 @@ var init_scenario_store = __esm({
|
|
|
21843
21843
|
}
|
|
21844
21844
|
});
|
|
21845
21845
|
|
|
21846
|
+
// ../../apps/server/src/services/runtimes/claude-code/check-dependency.ts
|
|
21847
|
+
var check_dependency_exports = {};
|
|
21848
|
+
__export(check_dependency_exports, {
|
|
21849
|
+
checkClaudeDependency: () => checkClaudeDependency
|
|
21850
|
+
});
|
|
21851
|
+
import { execFileSync as execFileSync2 } from "child_process";
|
|
21852
|
+
function getInstallHint() {
|
|
21853
|
+
if (process.platform === "win32") {
|
|
21854
|
+
return "irm https://claude.ai/install.ps1 | iex";
|
|
21855
|
+
}
|
|
21856
|
+
return "curl -fsSL https://claude.ai/install.sh | bash";
|
|
21857
|
+
}
|
|
21858
|
+
function checkClaudeDependency() {
|
|
21859
|
+
try {
|
|
21860
|
+
const version2 = execFileSync2("claude", ["--version"], {
|
|
21861
|
+
encoding: "utf-8",
|
|
21862
|
+
timeout: 5e3,
|
|
21863
|
+
stdio: ["pipe", "pipe", "pipe"]
|
|
21864
|
+
}).trim();
|
|
21865
|
+
return {
|
|
21866
|
+
name: "Claude Code CLI",
|
|
21867
|
+
description: "The Claude Code CLI powers agent sessions in DorkOS.",
|
|
21868
|
+
status: "satisfied",
|
|
21869
|
+
version: version2
|
|
21870
|
+
};
|
|
21871
|
+
} catch {
|
|
21872
|
+
return {
|
|
21873
|
+
name: "Claude Code CLI",
|
|
21874
|
+
description: "The Claude Code CLI powers agent sessions in DorkOS.",
|
|
21875
|
+
status: "missing",
|
|
21876
|
+
installHint: getInstallHint(),
|
|
21877
|
+
infoUrl: "https://docs.anthropic.com/en/docs/claude-code"
|
|
21878
|
+
};
|
|
21879
|
+
}
|
|
21880
|
+
}
|
|
21881
|
+
var init_check_dependency = __esm({
|
|
21882
|
+
"../../apps/server/src/services/runtimes/claude-code/check-dependency.ts"() {
|
|
21883
|
+
"use strict";
|
|
21884
|
+
}
|
|
21885
|
+
});
|
|
21886
|
+
|
|
21846
21887
|
// ../../node_modules/.pnpm/giget@3.2.0/node_modules/giget/dist/_chunks/rolldown-runtime.mjs
|
|
21847
21888
|
var __defProp2, __exportAll;
|
|
21848
21889
|
var init_rolldown_runtime = __esm({
|
|
@@ -29932,10 +29973,10 @@ var require_composer = __commonJS({
|
|
|
29932
29973
|
* @param routeHandlers Handlers for every route
|
|
29933
29974
|
* @param fallback Optional fallback middleware if no route matches
|
|
29934
29975
|
*/
|
|
29935
|
-
route(
|
|
29976
|
+
route(router16, routeHandlers, fallback = pass) {
|
|
29936
29977
|
return this.lazy(async (ctx) => {
|
|
29937
29978
|
var _a2;
|
|
29938
|
-
const route = await
|
|
29979
|
+
const route = await router16(ctx);
|
|
29939
29980
|
return (_a2 = route === void 0 || !routeHandlers[route] ? fallback : routeHandlers[route]) !== null && _a2 !== void 0 ? _a2 : [];
|
|
29940
29981
|
});
|
|
29941
29982
|
}
|
|
@@ -71128,7 +71169,7 @@ var require_ExpressReceiver = __commonJS({
|
|
|
71128
71169
|
processEventErrorHandler;
|
|
71129
71170
|
unhandledRequestHandler;
|
|
71130
71171
|
unhandledRequestTimeoutMillis;
|
|
71131
|
-
constructor({ signingSecret = "", logger: logger3 = void 0, logLevel = logger_1.LogLevel.INFO, endpoints = { events: "/slack/events" }, processBeforeResponse = false, signatureVerification = true, clientId = void 0, clientSecret = void 0, stateSecret = void 0, redirectUri = void 0, installationStore = void 0, scopes = void 0, installerOptions = {}, app = void 0, router:
|
|
71172
|
+
constructor({ signingSecret = "", logger: logger3 = void 0, logLevel = logger_1.LogLevel.INFO, endpoints = { events: "/slack/events" }, processBeforeResponse = false, signatureVerification = true, clientId = void 0, clientSecret = void 0, stateSecret = void 0, redirectUri = void 0, installationStore = void 0, scopes = void 0, installerOptions = {}, app = void 0, router: router16 = void 0, customPropertiesExtractor = (_req) => ({}), dispatchErrorHandler = httpFunc.defaultAsyncDispatchErrorHandler, processEventErrorHandler = httpFunc.defaultProcessEventErrorHandler, unhandledRequestHandler = httpFunc.defaultUnhandledRequestHandler, unhandledRequestTimeoutMillis = 3001 }) {
|
|
71132
71173
|
this.app = app !== void 0 ? app : (0, express_1.default)();
|
|
71133
71174
|
if (typeof logger3 !== "undefined") {
|
|
71134
71175
|
this.logger = logger3;
|
|
@@ -71146,7 +71187,7 @@ var require_ExpressReceiver = __commonJS({
|
|
|
71146
71187
|
];
|
|
71147
71188
|
this.processBeforeResponse = processBeforeResponse;
|
|
71148
71189
|
const endpointList = typeof endpoints === "string" ? [endpoints] : Object.values(endpoints);
|
|
71149
|
-
this.router =
|
|
71190
|
+
this.router = router16 !== void 0 ? router16 : (0, express_1.Router)();
|
|
71150
71191
|
for (const endpoint of endpointList) {
|
|
71151
71192
|
this.router.post(endpoint, ...expressMiddleware);
|
|
71152
71193
|
}
|
|
@@ -81287,6 +81328,15 @@ var init_test_mode_runtime = __esm({
|
|
|
81287
81328
|
async getCommands(_forceRefresh, _cwd) {
|
|
81288
81329
|
return { commands: [], lastScanned: "" };
|
|
81289
81330
|
}
|
|
81331
|
+
async checkDependencies() {
|
|
81332
|
+
return [
|
|
81333
|
+
{
|
|
81334
|
+
name: "Test Mode Runtime",
|
|
81335
|
+
description: "No external dependencies required.",
|
|
81336
|
+
status: "satisfied"
|
|
81337
|
+
}
|
|
81338
|
+
];
|
|
81339
|
+
}
|
|
81290
81340
|
checkSessionHealth() {
|
|
81291
81341
|
}
|
|
81292
81342
|
approveTool(_id, _toolCallId, _approved) {
|
|
@@ -81301,6 +81351,9 @@ var init_test_mode_runtime = __esm({
|
|
|
81301
81351
|
async stopTask(_sessionId, _taskId) {
|
|
81302
81352
|
return false;
|
|
81303
81353
|
}
|
|
81354
|
+
async interruptQuery(_sessionId) {
|
|
81355
|
+
return false;
|
|
81356
|
+
}
|
|
81304
81357
|
};
|
|
81305
81358
|
}
|
|
81306
81359
|
});
|
|
@@ -81983,7 +82036,20 @@ var ServerConfigSchema = z.object({
|
|
|
81983
82036
|
relay: z.object({
|
|
81984
82037
|
enabled: z.boolean().openapi({ description: "Whether the Relay message bus is enabled" })
|
|
81985
82038
|
}).optional().openapi({ description: "Relay message bus feature state" }),
|
|
82039
|
+
scheduler: z.object({
|
|
82040
|
+
maxConcurrentRuns: z.number().int().openapi({ description: "Maximum concurrent task runs (1-10)" }),
|
|
82041
|
+
timezone: z.string().nullable().openapi({
|
|
82042
|
+
description: "IANA timezone for cron expressions, or null for system default"
|
|
82043
|
+
}),
|
|
82044
|
+
retentionCount: z.number().int().openapi({ description: "Number of task run history records to retain" })
|
|
82045
|
+
}).optional().openapi({ description: "Task scheduler configuration" }),
|
|
82046
|
+
logging: z.object({
|
|
82047
|
+
level: z.string().openapi({ description: "Log verbosity level (fatal, error, warn, info, debug, trace)" }),
|
|
82048
|
+
maxLogSizeKb: z.number().int().openapi({ description: "Maximum log file size in KB before rotation" }),
|
|
82049
|
+
maxLogFiles: z.number().int().openapi({ description: "Number of rotated log files to retain" })
|
|
82050
|
+
}).optional().openapi({ description: "Logging configuration" }),
|
|
81986
82051
|
boundary: z.string().openapi({ description: "Server boundary path (home directory or configured boundary)" }),
|
|
82052
|
+
dorkHome: z.string().openapi({ description: "Data directory path (~/.dork or configured DORK_HOME)" }),
|
|
81987
82053
|
mesh: z.object({
|
|
81988
82054
|
enabled: z.boolean().openapi({ description: "Whether the Mesh agent discovery subsystem is enabled" }),
|
|
81989
82055
|
scanRoots: z.array(z.string()).optional().openapi({ description: "User-configured scan roots for agent discovery" })
|
|
@@ -81997,7 +82063,8 @@ var ServerConfigSchema = z.object({
|
|
|
81997
82063
|
agentContext: z.object({
|
|
81998
82064
|
relayTools: z.boolean().openapi({ description: "Whether relay tool context is injected into agent prompts" }),
|
|
81999
82065
|
meshTools: z.boolean().openapi({ description: "Whether mesh tool context is injected into agent prompts" }),
|
|
82000
|
-
adapterTools: z.boolean().openapi({ description: "Whether adapter tool context is injected into agent prompts" })
|
|
82066
|
+
adapterTools: z.boolean().openapi({ description: "Whether adapter tool context is injected into agent prompts" }),
|
|
82067
|
+
tasksTools: z.boolean().openapi({ description: "Whether tasks tool context is injected into agent prompts" })
|
|
82001
82068
|
}).optional().openapi({ description: "Agent tool context injection toggles" }),
|
|
82002
82069
|
agents: z.object({
|
|
82003
82070
|
defaultDirectory: z.string().openapi({ description: "Default directory for agent workspaces" }),
|
|
@@ -82725,6 +82792,17 @@ router.post("/:id/tasks/:taskId/stop", async (req, res) => {
|
|
|
82725
82792
|
return sendError(res, 500, "Failed to stop task", "STOP_TASK_ERROR");
|
|
82726
82793
|
}
|
|
82727
82794
|
});
|
|
82795
|
+
router.post("/:id/interrupt", async (req, res) => {
|
|
82796
|
+
const sessionId = parseSessionId(req.params.id);
|
|
82797
|
+
if (!sessionId) return sendError(res, 400, "Invalid session ID", "INVALID_SESSION_ID");
|
|
82798
|
+
const runtime = runtimeRegistry.getDefault();
|
|
82799
|
+
try {
|
|
82800
|
+
const interrupted = await runtime.interruptQuery(sessionId);
|
|
82801
|
+
res.json({ ok: interrupted });
|
|
82802
|
+
} catch (_err) {
|
|
82803
|
+
return sendError(res, 500, "Failed to interrupt query", "INTERRUPT_ERROR");
|
|
82804
|
+
}
|
|
82805
|
+
});
|
|
82728
82806
|
router.get("/:id/stream", async (req, res) => {
|
|
82729
82807
|
const sessionId = parseSessionId(req.params.id);
|
|
82730
82808
|
if (!sessionId) return sendError(res, 400, "Invalid session ID", "INVALID_SESSION_ID");
|
|
@@ -83110,7 +83188,7 @@ var SERVER_VERSION = resolveVersion();
|
|
|
83110
83188
|
var IS_DEV_BUILD = checkDevBuild(SERVER_VERSION);
|
|
83111
83189
|
function resolveVersion() {
|
|
83112
83190
|
if (env.DORKOS_VERSION_OVERRIDE) return env.DORKOS_VERSION_OVERRIDE;
|
|
83113
|
-
if (true) return "0.
|
|
83191
|
+
if (true) return "0.33.0";
|
|
83114
83192
|
const pkgPath = path5.join(path5.dirname(fileURLToPath2(import.meta.url)), "../../package.json");
|
|
83115
83193
|
return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
|
|
83116
83194
|
}
|
|
@@ -83374,6 +83452,8 @@ router5.get("/", async (_req, res) => {
|
|
|
83374
83452
|
uptime: process.uptime(),
|
|
83375
83453
|
workingDirectory: process.cwd(),
|
|
83376
83454
|
boundary: getBoundary(),
|
|
83455
|
+
// Set by index.ts at startup before routes are registered — always present at request time
|
|
83456
|
+
dorkHome: process.env.DORK_HOME,
|
|
83377
83457
|
nodeVersion: process.version,
|
|
83378
83458
|
claudeCliPath,
|
|
83379
83459
|
tunnel: {
|
|
@@ -83389,6 +83469,16 @@ router5.get("/", async (_req, res) => {
|
|
|
83389
83469
|
enabled: isRelayEnabled(),
|
|
83390
83470
|
...getRelayInitError() && { initError: getRelayInitError() }
|
|
83391
83471
|
},
|
|
83472
|
+
scheduler: configManager.get("scheduler") ?? {
|
|
83473
|
+
maxConcurrentRuns: 1,
|
|
83474
|
+
timezone: null,
|
|
83475
|
+
retentionCount: 100
|
|
83476
|
+
},
|
|
83477
|
+
logging: configManager.get("logging") ?? {
|
|
83478
|
+
level: "info",
|
|
83479
|
+
maxLogSizeKb: 500,
|
|
83480
|
+
maxLogFiles: 14
|
|
83481
|
+
},
|
|
83392
83482
|
mesh: {
|
|
83393
83483
|
enabled: true,
|
|
83394
83484
|
scanRoots: configManager.get("mesh")?.scanRoots ?? [],
|
|
@@ -84785,10 +84875,26 @@ router11.get("/", (_req, res) => {
|
|
|
84785
84875
|
});
|
|
84786
84876
|
var capabilities_default = router11;
|
|
84787
84877
|
|
|
84878
|
+
// ../../apps/server/src/routes/system.ts
|
|
84879
|
+
import { Router as Router12 } from "express";
|
|
84880
|
+
var router12 = Router12();
|
|
84881
|
+
router12.get("/requirements", async (_req, res) => {
|
|
84882
|
+
const runtimes = {};
|
|
84883
|
+
for (const runtime of runtimeRegistry.listRuntimes()) {
|
|
84884
|
+
const dependencies = await runtime.checkDependencies();
|
|
84885
|
+
runtimes[runtime.type] = { dependencies };
|
|
84886
|
+
}
|
|
84887
|
+
const allSatisfied = Object.values(runtimes).every(
|
|
84888
|
+
(r5) => r5.dependencies.every((d5) => d5.status === "satisfied")
|
|
84889
|
+
);
|
|
84890
|
+
res.json({ runtimes, allSatisfied });
|
|
84891
|
+
});
|
|
84892
|
+
var system_default = router12;
|
|
84893
|
+
|
|
84788
84894
|
// ../../apps/server/src/routes/uploads.ts
|
|
84789
84895
|
var import_multer2 = __toESM(require_multer(), 1);
|
|
84790
84896
|
import path9 from "path";
|
|
84791
|
-
import { Router as
|
|
84897
|
+
import { Router as Router13 } from "express";
|
|
84792
84898
|
|
|
84793
84899
|
// ../../apps/server/src/services/core/upload-handler.ts
|
|
84794
84900
|
var import_multer = __toESM(require_multer(), 1);
|
|
@@ -84843,8 +84949,8 @@ var UploadHandler = class {
|
|
|
84843
84949
|
var uploadHandler = new UploadHandler();
|
|
84844
84950
|
|
|
84845
84951
|
// ../../apps/server/src/routes/uploads.ts
|
|
84846
|
-
var
|
|
84847
|
-
|
|
84952
|
+
var router13 = Router13();
|
|
84953
|
+
router13.post("/", async (req, res) => {
|
|
84848
84954
|
try {
|
|
84849
84955
|
const cwd = req.query.cwd;
|
|
84850
84956
|
if (!cwd || typeof cwd !== "string") {
|
|
@@ -84882,7 +84988,7 @@ router12.post("/", async (req, res) => {
|
|
|
84882
84988
|
throw err;
|
|
84883
84989
|
}
|
|
84884
84990
|
});
|
|
84885
|
-
|
|
84991
|
+
router13.get("/:filename", async (req, res) => {
|
|
84886
84992
|
try {
|
|
84887
84993
|
const cwd = req.query.cwd;
|
|
84888
84994
|
if (!cwd || typeof cwd !== "string") {
|
|
@@ -84909,18 +85015,18 @@ router12.get("/:filename", async (req, res) => {
|
|
|
84909
85015
|
throw err;
|
|
84910
85016
|
}
|
|
84911
85017
|
});
|
|
84912
|
-
var uploads_default =
|
|
85018
|
+
var uploads_default = router13;
|
|
84913
85019
|
|
|
84914
85020
|
// ../../apps/server/src/routes/mcp-config.ts
|
|
84915
|
-
import { Router as
|
|
85021
|
+
import { Router as Router14 } from "express";
|
|
84916
85022
|
import { readFile } from "fs/promises";
|
|
84917
85023
|
import path10 from "path";
|
|
84918
85024
|
import { z as z9 } from "zod";
|
|
84919
|
-
var
|
|
85025
|
+
var router14 = Router14();
|
|
84920
85026
|
var QuerySchema = z9.object({
|
|
84921
85027
|
path: z9.string().min(1)
|
|
84922
85028
|
});
|
|
84923
|
-
|
|
85029
|
+
router14.get("/", async (req, res) => {
|
|
84924
85030
|
const parsed = QuerySchema.safeParse(req.query);
|
|
84925
85031
|
if (!parsed.success) {
|
|
84926
85032
|
return res.status(400).json({ error: "Missing required query param: path" });
|
|
@@ -84953,10 +85059,10 @@ router13.get("/", async (req, res) => {
|
|
|
84953
85059
|
throw err;
|
|
84954
85060
|
}
|
|
84955
85061
|
});
|
|
84956
|
-
var mcp_config_default =
|
|
85062
|
+
var mcp_config_default = router14;
|
|
84957
85063
|
|
|
84958
85064
|
// ../../apps/server/src/routes/events.ts
|
|
84959
|
-
import { Router as
|
|
85065
|
+
import { Router as Router15 } from "express";
|
|
84960
85066
|
|
|
84961
85067
|
// ../../apps/server/src/services/core/event-fan-out.ts
|
|
84962
85068
|
init_logger();
|
|
@@ -85005,8 +85111,8 @@ data: ${JSON.stringify(data)}
|
|
|
85005
85111
|
var eventFanOut = new EventFanOut();
|
|
85006
85112
|
|
|
85007
85113
|
// ../../apps/server/src/routes/events.ts
|
|
85008
|
-
var
|
|
85009
|
-
|
|
85114
|
+
var router15 = Router15();
|
|
85115
|
+
router15.get("/", (req, res) => {
|
|
85010
85116
|
const unsubscribe = eventFanOut.addClient(res);
|
|
85011
85117
|
if (res.writableEnded) return;
|
|
85012
85118
|
initSSEStream(res);
|
|
@@ -85032,7 +85138,7 @@ data: ${JSON.stringify({ connectedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
|
85032
85138
|
unsubscribe();
|
|
85033
85139
|
});
|
|
85034
85140
|
});
|
|
85035
|
-
var events_default =
|
|
85141
|
+
var events_default = router15;
|
|
85036
85142
|
|
|
85037
85143
|
// ../../apps/server/src/services/core/openapi-registry.ts
|
|
85038
85144
|
init_env();
|
|
@@ -86671,7 +86777,7 @@ function tunnelPasscodeAuth(req, res, next) {
|
|
|
86671
86777
|
}
|
|
86672
86778
|
|
|
86673
86779
|
// ../../apps/server/src/routes/test-control.ts
|
|
86674
|
-
import { Router as
|
|
86780
|
+
import { Router as Router16 } from "express";
|
|
86675
86781
|
import os2 from "os";
|
|
86676
86782
|
import path12 from "path";
|
|
86677
86783
|
import { z as z16 } from "zod";
|
|
@@ -86978,7 +87084,7 @@ async function removeManifest(projectPath) {
|
|
|
86978
87084
|
|
|
86979
87085
|
// ../../apps/server/src/routes/test-control.ts
|
|
86980
87086
|
init_scenario_store();
|
|
86981
|
-
var testControlRouter =
|
|
87087
|
+
var testControlRouter = Router16();
|
|
86982
87088
|
var scenarioSchema = z16.object({
|
|
86983
87089
|
name: z16.string().min(1),
|
|
86984
87090
|
sessionId: z16.string().uuid().optional()
|
|
@@ -87085,6 +87191,7 @@ function createApp() {
|
|
|
87085
87191
|
app.use("/api/models", models_default);
|
|
87086
87192
|
app.use("/api/subagents", subagents_default);
|
|
87087
87193
|
app.use("/api/capabilities", capabilities_default);
|
|
87194
|
+
app.use("/api/system", system_default);
|
|
87088
87195
|
app.use("/api/uploads", uploads_default);
|
|
87089
87196
|
app.use("/api/mcp-config", mcp_config_default);
|
|
87090
87197
|
app.use("/api/events", events_default);
|
|
@@ -87326,6 +87433,27 @@ var SessionStore = class {
|
|
|
87326
87433
|
return false;
|
|
87327
87434
|
}
|
|
87328
87435
|
}
|
|
87436
|
+
/**
|
|
87437
|
+
* Interrupt the active query for a session.
|
|
87438
|
+
*
|
|
87439
|
+
* Tries `query.interrupt()` first (graceful). If that throws,
|
|
87440
|
+
* falls back to `query.close()` (forceful subprocess termination).
|
|
87441
|
+
*/
|
|
87442
|
+
async interruptQuery(sessionId) {
|
|
87443
|
+
const session = this.findSession(sessionId);
|
|
87444
|
+
if (!session?.activeQuery) return false;
|
|
87445
|
+
try {
|
|
87446
|
+
await session.activeQuery.interrupt();
|
|
87447
|
+
return true;
|
|
87448
|
+
} catch {
|
|
87449
|
+
try {
|
|
87450
|
+
session.activeQuery.close();
|
|
87451
|
+
return true;
|
|
87452
|
+
} catch {
|
|
87453
|
+
return false;
|
|
87454
|
+
}
|
|
87455
|
+
}
|
|
87456
|
+
}
|
|
87329
87457
|
// ---------------------------------------------------------------------------
|
|
87330
87458
|
// Lifecycle
|
|
87331
87459
|
// ---------------------------------------------------------------------------
|
|
@@ -92267,6 +92395,11 @@ var ClaudeCodeRuntime = class _ClaudeCodeRuntime {
|
|
|
92267
92395
|
getCapabilities() {
|
|
92268
92396
|
return CLAUDE_CODE_CAPABILITIES;
|
|
92269
92397
|
}
|
|
92398
|
+
/** Check whether the Claude Code CLI binary is available. */
|
|
92399
|
+
async checkDependencies() {
|
|
92400
|
+
const { checkClaudeDependency: checkClaudeDependency2 } = await Promise.resolve().then(() => (init_check_dependency(), check_dependency_exports));
|
|
92401
|
+
return [checkClaudeDependency2()];
|
|
92402
|
+
}
|
|
92270
92403
|
// ---------------------------------------------------------------------------
|
|
92271
92404
|
// Dependency injection
|
|
92272
92405
|
// ---------------------------------------------------------------------------
|
|
@@ -92374,6 +92507,10 @@ var ClaudeCodeRuntime = class _ClaudeCodeRuntime {
|
|
|
92374
92507
|
async stopTask(sessionId, taskId) {
|
|
92375
92508
|
return this.sessionStore.stopTask(sessionId, taskId);
|
|
92376
92509
|
}
|
|
92510
|
+
/** @inheritdoc */
|
|
92511
|
+
async interruptQuery(sessionId) {
|
|
92512
|
+
return this.sessionStore.interruptQuery(sessionId);
|
|
92513
|
+
}
|
|
92377
92514
|
// ---------------------------------------------------------------------------
|
|
92378
92515
|
// Session queries (delegated to TranscriptReader)
|
|
92379
92516
|
// ---------------------------------------------------------------------------
|
|
@@ -94027,7 +94164,7 @@ import { z as z31 } from "zod";
|
|
|
94027
94164
|
|
|
94028
94165
|
// ../../apps/server/src/routes/extensions.ts
|
|
94029
94166
|
init_logger();
|
|
94030
|
-
import { Router as
|
|
94167
|
+
import { Router as Router17 } from "express";
|
|
94031
94168
|
import fs11 from "fs/promises";
|
|
94032
94169
|
import path18 from "path";
|
|
94033
94170
|
import { z as z30 } from "zod";
|
|
@@ -94228,8 +94365,8 @@ var SetSettingBodySchema = z30.object({
|
|
|
94228
94365
|
});
|
|
94229
94366
|
var SAFE_EXT_ID = /^[a-z0-9][a-z0-9-]*$/;
|
|
94230
94367
|
function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
94231
|
-
const
|
|
94232
|
-
|
|
94368
|
+
const router16 = Router17();
|
|
94369
|
+
router16.get("/events", (_req, res) => {
|
|
94233
94370
|
logger.warn("[DEPRECATED] GET /api/extensions/events \u2014 use GET /api/events instead");
|
|
94234
94371
|
res.set({
|
|
94235
94372
|
"Content-Type": "text/event-stream",
|
|
@@ -94243,7 +94380,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94243
94380
|
sseClients.delete(res);
|
|
94244
94381
|
});
|
|
94245
94382
|
});
|
|
94246
|
-
|
|
94383
|
+
router16.get("/", async (_req, res) => {
|
|
94247
94384
|
try {
|
|
94248
94385
|
const extensions = extensionManager2.listPublic();
|
|
94249
94386
|
res.json(extensions);
|
|
@@ -94252,7 +94389,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94252
94389
|
res.status(500).json({ error: "Failed to list extensions" });
|
|
94253
94390
|
}
|
|
94254
94391
|
});
|
|
94255
|
-
|
|
94392
|
+
router16.post("/:id/enable", async (req, res) => {
|
|
94256
94393
|
try {
|
|
94257
94394
|
const { id } = req.params;
|
|
94258
94395
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94279,7 +94416,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94279
94416
|
res.status(500).json({ error: "Failed to enable extension" });
|
|
94280
94417
|
}
|
|
94281
94418
|
});
|
|
94282
|
-
|
|
94419
|
+
router16.post("/:id/disable", async (req, res) => {
|
|
94283
94420
|
try {
|
|
94284
94421
|
const { id } = req.params;
|
|
94285
94422
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94306,7 +94443,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94306
94443
|
res.status(500).json({ error: "Failed to disable extension" });
|
|
94307
94444
|
}
|
|
94308
94445
|
});
|
|
94309
|
-
|
|
94446
|
+
router16.post("/:id/init-server", async (req, res) => {
|
|
94310
94447
|
try {
|
|
94311
94448
|
const { id } = req.params;
|
|
94312
94449
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94320,7 +94457,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94320
94457
|
res.status(500).json({ error: "Failed to initialize server extension" });
|
|
94321
94458
|
}
|
|
94322
94459
|
});
|
|
94323
|
-
|
|
94460
|
+
router16.post("/reload", async (_req, res) => {
|
|
94324
94461
|
try {
|
|
94325
94462
|
const extensions = await extensionManager2.reload();
|
|
94326
94463
|
res.json(extensions);
|
|
@@ -94329,7 +94466,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94329
94466
|
res.status(500).json({ error: "Failed to reload extensions" });
|
|
94330
94467
|
}
|
|
94331
94468
|
});
|
|
94332
|
-
|
|
94469
|
+
router16.post("/cwd-changed", async (req, res) => {
|
|
94333
94470
|
try {
|
|
94334
94471
|
const parsed = CwdChangedBodySchema.safeParse(req.body);
|
|
94335
94472
|
if (!parsed.success) {
|
|
@@ -94349,7 +94486,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94349
94486
|
res.status(500).json({ error: "Failed to handle CWD change" });
|
|
94350
94487
|
}
|
|
94351
94488
|
});
|
|
94352
|
-
|
|
94489
|
+
router16.get("/:id/bundle", async (req, res) => {
|
|
94353
94490
|
try {
|
|
94354
94491
|
const { id } = req.params;
|
|
94355
94492
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94365,7 +94502,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94365
94502
|
res.status(500).json({ error: "Failed to serve bundle" });
|
|
94366
94503
|
}
|
|
94367
94504
|
});
|
|
94368
|
-
|
|
94505
|
+
router16.get("/:id/data", async (req, res) => {
|
|
94369
94506
|
try {
|
|
94370
94507
|
const { id } = req.params;
|
|
94371
94508
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94384,7 +94521,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94384
94521
|
res.status(500).json({ error: "Failed to read extension data" });
|
|
94385
94522
|
}
|
|
94386
94523
|
});
|
|
94387
|
-
|
|
94524
|
+
router16.put("/:id/data", async (req, res) => {
|
|
94388
94525
|
try {
|
|
94389
94526
|
const { id } = req.params;
|
|
94390
94527
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94402,7 +94539,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94402
94539
|
res.status(500).json({ error: "Failed to write extension data" });
|
|
94403
94540
|
}
|
|
94404
94541
|
});
|
|
94405
|
-
|
|
94542
|
+
router16.get("/:id/secrets", async (req, res) => {
|
|
94406
94543
|
try {
|
|
94407
94544
|
const { id } = req.params;
|
|
94408
94545
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94427,7 +94564,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94427
94564
|
res.status(500).json({ error: "Failed to list secrets" });
|
|
94428
94565
|
}
|
|
94429
94566
|
});
|
|
94430
|
-
|
|
94567
|
+
router16.put("/:id/secrets/:key", async (req, res) => {
|
|
94431
94568
|
try {
|
|
94432
94569
|
const { id, key } = req.params;
|
|
94433
94570
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94464,7 +94601,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94464
94601
|
res.status(500).json({ error: "Failed to set secret" });
|
|
94465
94602
|
}
|
|
94466
94603
|
});
|
|
94467
|
-
|
|
94604
|
+
router16.delete("/:id/secrets/:key", async (req, res) => {
|
|
94468
94605
|
try {
|
|
94469
94606
|
const { id, key } = req.params;
|
|
94470
94607
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94480,7 +94617,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94480
94617
|
res.status(500).json({ error: "Failed to delete secret" });
|
|
94481
94618
|
}
|
|
94482
94619
|
});
|
|
94483
|
-
|
|
94620
|
+
router16.get("/:id/settings", async (req, res) => {
|
|
94484
94621
|
try {
|
|
94485
94622
|
const { id } = req.params;
|
|
94486
94623
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94513,7 +94650,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94513
94650
|
res.status(500).json({ error: "Failed to list settings" });
|
|
94514
94651
|
}
|
|
94515
94652
|
});
|
|
94516
|
-
|
|
94653
|
+
router16.put("/:id/settings/:key", async (req, res) => {
|
|
94517
94654
|
try {
|
|
94518
94655
|
const { id, key } = req.params;
|
|
94519
94656
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94550,7 +94687,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94550
94687
|
res.status(500).json({ error: "Failed to set setting" });
|
|
94551
94688
|
}
|
|
94552
94689
|
});
|
|
94553
|
-
|
|
94690
|
+
router16.delete("/:id/settings/:key", async (req, res) => {
|
|
94554
94691
|
try {
|
|
94555
94692
|
const { id, key } = req.params;
|
|
94556
94693
|
if (!SAFE_EXT_ID.test(id)) return res.status(400).json({ error: "Invalid extension ID" });
|
|
@@ -94566,7 +94703,7 @@ function createExtensionsRouter(extensionManager2, dorkHome, getCwd) {
|
|
|
94566
94703
|
res.status(500).json({ error: "Failed to delete setting" });
|
|
94567
94704
|
}
|
|
94568
94705
|
});
|
|
94569
|
-
return
|
|
94706
|
+
return router16;
|
|
94570
94707
|
}
|
|
94571
94708
|
function resolveDataPath(id, manager, dorkHome, getCwd) {
|
|
94572
94709
|
const record2 = manager.get(id);
|
|
@@ -102071,7 +102208,7 @@ async function loadTemplates(dorkHome) {
|
|
|
102071
102208
|
|
|
102072
102209
|
// ../../apps/server/src/routes/tasks.ts
|
|
102073
102210
|
import path26 from "node:path";
|
|
102074
|
-
import { Router as
|
|
102211
|
+
import { Router as Router18 } from "express";
|
|
102075
102212
|
|
|
102076
102213
|
// ../skills/dist/slug.js
|
|
102077
102214
|
function slugify(displayName) {
|
|
@@ -102081,19 +102218,19 @@ function slugify(displayName) {
|
|
|
102081
102218
|
// ../../apps/server/src/routes/tasks.ts
|
|
102082
102219
|
import fs15 from "node:fs/promises";
|
|
102083
102220
|
function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityService) {
|
|
102084
|
-
const
|
|
102085
|
-
|
|
102221
|
+
const router16 = Router18();
|
|
102222
|
+
router16.get("/templates", async (_req, res) => {
|
|
102086
102223
|
const templates = await loadTemplates(dorkHome);
|
|
102087
102224
|
return res.json(templates);
|
|
102088
102225
|
});
|
|
102089
|
-
|
|
102226
|
+
router16.get("/", (_req, res) => {
|
|
102090
102227
|
const schedules = store.getTasks().map((s5) => ({
|
|
102091
102228
|
...s5,
|
|
102092
102229
|
nextRun: scheduler.getNextRun(s5.id)?.toISOString() ?? null
|
|
102093
102230
|
}));
|
|
102094
102231
|
res.json(schedules);
|
|
102095
102232
|
});
|
|
102096
|
-
|
|
102233
|
+
router16.post("/", async (req, res) => {
|
|
102097
102234
|
const data = parseBody(CreateTaskRequestSchema, req.body, res);
|
|
102098
102235
|
if (!data) return;
|
|
102099
102236
|
const slug = slugify(data.name);
|
|
@@ -102167,7 +102304,7 @@ function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityServic
|
|
|
102167
102304
|
});
|
|
102168
102305
|
return res.status(201).json(schedule);
|
|
102169
102306
|
});
|
|
102170
|
-
|
|
102307
|
+
router16.patch("/:id", async (req, res) => {
|
|
102171
102308
|
const data = parseBody(UpdateTaskRequestSchema, req.body, res);
|
|
102172
102309
|
if (!data) return;
|
|
102173
102310
|
const existing = store.getTask(req.params.id);
|
|
@@ -102227,7 +102364,7 @@ function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityServic
|
|
|
102227
102364
|
}
|
|
102228
102365
|
return res.json(updated);
|
|
102229
102366
|
});
|
|
102230
|
-
|
|
102367
|
+
router16.delete("/:id", async (_req, res) => {
|
|
102231
102368
|
const { id } = _req.params;
|
|
102232
102369
|
const schedule = store.getTask(id);
|
|
102233
102370
|
if (!schedule) {
|
|
@@ -102256,14 +102393,14 @@ function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityServic
|
|
|
102256
102393
|
});
|
|
102257
102394
|
return res.json({ success: true });
|
|
102258
102395
|
});
|
|
102259
|
-
|
|
102396
|
+
router16.post("/:id/trigger", async (_req, res) => {
|
|
102260
102397
|
const run = await scheduler.triggerManualRun(_req.params.id);
|
|
102261
102398
|
if (!run) {
|
|
102262
102399
|
return res.status(404).json({ error: "Schedule not found" });
|
|
102263
102400
|
}
|
|
102264
102401
|
return res.status(201).json({ runId: run.id });
|
|
102265
102402
|
});
|
|
102266
|
-
|
|
102403
|
+
router16.get("/runs", (req, res) => {
|
|
102267
102404
|
const data = parseBody(ListTaskRunsQuerySchema, req.query, res);
|
|
102268
102405
|
if (!data) return;
|
|
102269
102406
|
const runs = store.listRuns({
|
|
@@ -102274,14 +102411,14 @@ function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityServic
|
|
|
102274
102411
|
});
|
|
102275
102412
|
return res.json(runs);
|
|
102276
102413
|
});
|
|
102277
|
-
|
|
102414
|
+
router16.get("/runs/:id", (req, res) => {
|
|
102278
102415
|
const run = store.getRun(req.params.id);
|
|
102279
102416
|
if (!run) {
|
|
102280
102417
|
return res.status(404).json({ error: "Run not found" });
|
|
102281
102418
|
}
|
|
102282
102419
|
res.json(run);
|
|
102283
102420
|
});
|
|
102284
|
-
|
|
102421
|
+
router16.post("/runs/:id/cancel", (req, res) => {
|
|
102285
102422
|
const run = store.getRun(req.params.id);
|
|
102286
102423
|
const cancelled = scheduler.cancelRun(req.params.id);
|
|
102287
102424
|
if (!cancelled) {
|
|
@@ -102303,7 +102440,7 @@ function createTasksRouter(store, scheduler, dorkHome, meshCore2, activityServic
|
|
|
102303
102440
|
}
|
|
102304
102441
|
return res.json({ success: true });
|
|
102305
102442
|
});
|
|
102306
|
-
return
|
|
102443
|
+
return router16;
|
|
102307
102444
|
}
|
|
102308
102445
|
|
|
102309
102446
|
// ../relay/dist/relay-core.js
|
|
@@ -128297,7 +128434,7 @@ function validateAdapterShape(obj, id) {
|
|
|
128297
128434
|
}
|
|
128298
128435
|
|
|
128299
128436
|
// ../../apps/server/src/routes/relay.ts
|
|
128300
|
-
import { Router as
|
|
128437
|
+
import { Router as Router20 } from "express";
|
|
128301
128438
|
|
|
128302
128439
|
// ../../apps/server/src/services/relay/subject-resolver.ts
|
|
128303
128440
|
var SESSION_ID_PREVIEW_LENGTH = 7;
|
|
@@ -128339,7 +128476,7 @@ async function resolveSubjectLabels(subjects, deps) {
|
|
|
128339
128476
|
}
|
|
128340
128477
|
|
|
128341
128478
|
// ../../apps/server/src/routes/relay-adapters.ts
|
|
128342
|
-
import { Router as
|
|
128479
|
+
import { Router as Router19 } from "express";
|
|
128343
128480
|
import express2 from "express";
|
|
128344
128481
|
import { z as z36 } from "zod";
|
|
128345
128482
|
|
|
@@ -129817,8 +129954,8 @@ function resolveAdapterName(adapterManager2, adapterId) {
|
|
|
129817
129954
|
return info?.config.label || info?.config.id || adapterId;
|
|
129818
129955
|
}
|
|
129819
129956
|
function createAdapterRouter(adapterManager2, traceStore2) {
|
|
129820
|
-
const
|
|
129821
|
-
|
|
129957
|
+
const router16 = Router19();
|
|
129958
|
+
router16.get("/adapters/catalog", (_req, res) => {
|
|
129822
129959
|
try {
|
|
129823
129960
|
res.json(adapterManager2.getCatalog());
|
|
129824
129961
|
} catch (err) {
|
|
@@ -129826,7 +129963,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129826
129963
|
res.status(500).json({ error: message });
|
|
129827
129964
|
}
|
|
129828
129965
|
});
|
|
129829
|
-
|
|
129966
|
+
router16.post("/adapters/reload", async (_req, res) => {
|
|
129830
129967
|
try {
|
|
129831
129968
|
await adapterManager2.reload();
|
|
129832
129969
|
return res.json({ ok: true });
|
|
@@ -129835,13 +129972,13 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129835
129972
|
return res.status(500).json({ error: message });
|
|
129836
129973
|
}
|
|
129837
129974
|
});
|
|
129838
|
-
|
|
129839
|
-
|
|
129975
|
+
router16.get("/adapters", (_req, res) => res.json(adapterManager2.listAdapters()));
|
|
129976
|
+
router16.get("/adapters/:id", (req, res) => {
|
|
129840
129977
|
const adapter = adapterManager2.getAdapter(req.params.id);
|
|
129841
129978
|
if (!adapter) return res.status(404).json({ error: "Adapter not found" });
|
|
129842
129979
|
return res.json(adapter);
|
|
129843
129980
|
});
|
|
129844
|
-
|
|
129981
|
+
router16.post("/adapters/test", async (req, res) => {
|
|
129845
129982
|
const result2 = AdapterTestRequestSchema.safeParse(req.body);
|
|
129846
129983
|
if (!result2.success) {
|
|
129847
129984
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -129854,7 +129991,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129854
129991
|
return res.status(500).json({ error: message });
|
|
129855
129992
|
}
|
|
129856
129993
|
});
|
|
129857
|
-
|
|
129994
|
+
router16.post("/adapters", async (req, res) => {
|
|
129858
129995
|
const result2 = AdapterCreateRequestSchema.safeParse(req.body);
|
|
129859
129996
|
if (!result2.success) {
|
|
129860
129997
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -129885,7 +130022,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129885
130022
|
return res.status(500).json({ error: message });
|
|
129886
130023
|
}
|
|
129887
130024
|
});
|
|
129888
|
-
|
|
130025
|
+
router16.delete("/adapters/:id", async (req, res) => {
|
|
129889
130026
|
try {
|
|
129890
130027
|
const adapterName = adapterManager2.resolveAdapterName(req.params.id);
|
|
129891
130028
|
await adapterManager2.removeAdapter(req.params.id);
|
|
@@ -129909,7 +130046,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129909
130046
|
return res.status(500).json({ error: message });
|
|
129910
130047
|
}
|
|
129911
130048
|
});
|
|
129912
|
-
|
|
130049
|
+
router16.patch("/adapters/:id/config", async (req, res) => {
|
|
129913
130050
|
const result2 = AdapterConfigUpdateSchema.safeParse(req.body);
|
|
129914
130051
|
if (!result2.success) {
|
|
129915
130052
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -129923,7 +130060,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129923
130060
|
return res.status(500).json({ error: message });
|
|
129924
130061
|
}
|
|
129925
130062
|
});
|
|
129926
|
-
|
|
130063
|
+
router16.post("/adapters/:id/enable", async (req, res) => {
|
|
129927
130064
|
try {
|
|
129928
130065
|
await adapterManager2.enable(req.params.id);
|
|
129929
130066
|
return res.json({ ok: true });
|
|
@@ -129931,7 +130068,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129931
130068
|
return res.status(400).json({ error: err instanceof Error ? err.message : "Enable failed" });
|
|
129932
130069
|
}
|
|
129933
130070
|
});
|
|
129934
|
-
|
|
130071
|
+
router16.post("/adapters/:id/disable", async (req, res) => {
|
|
129935
130072
|
try {
|
|
129936
130073
|
await adapterManager2.disable(req.params.id);
|
|
129937
130074
|
return res.json({ ok: true });
|
|
@@ -129939,7 +130076,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129939
130076
|
return res.status(400).json({ error: err instanceof Error ? err.message : "Disable failed" });
|
|
129940
130077
|
}
|
|
129941
130078
|
});
|
|
129942
|
-
|
|
130079
|
+
router16.get("/adapters/:id/events", (_req, res) => {
|
|
129943
130080
|
if (!traceStore2) return res.status(404).json({ error: "Tracing not available" });
|
|
129944
130081
|
const { id } = _req.params;
|
|
129945
130082
|
const limitParam = parseInt(_req.query.limit);
|
|
@@ -129947,7 +130084,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129947
130084
|
const events = traceStore2.getAdapterEvents(id, limit);
|
|
129948
130085
|
return res.json({ events });
|
|
129949
130086
|
});
|
|
129950
|
-
|
|
130087
|
+
router16.get("/adapters/:id/chats", (_req, res) => {
|
|
129951
130088
|
if (!traceStore2) return res.status(404).json({ error: "Tracing not available" });
|
|
129952
130089
|
const { id } = _req.params;
|
|
129953
130090
|
const limitParam = parseInt(_req.query.limit);
|
|
@@ -129955,19 +130092,19 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
129955
130092
|
const chats = traceStore2.getObservedChats(id, limit);
|
|
129956
130093
|
return res.json({ chats });
|
|
129957
130094
|
});
|
|
129958
|
-
|
|
130095
|
+
router16.get("/bindings", (_req, res) => {
|
|
129959
130096
|
const bindingStore = adapterManager2.getBindingStore();
|
|
129960
130097
|
if (!bindingStore) return res.status(503).json({ error: "Binding subsystem not available" });
|
|
129961
130098
|
return res.json({ bindings: bindingStore.getAll() });
|
|
129962
130099
|
});
|
|
129963
|
-
|
|
130100
|
+
router16.get("/bindings/:id", (req, res) => {
|
|
129964
130101
|
const bindingStore = adapterManager2.getBindingStore();
|
|
129965
130102
|
if (!bindingStore) return res.status(503).json({ error: "Binding subsystem not available" });
|
|
129966
130103
|
const binding = bindingStore.getById(req.params.id);
|
|
129967
130104
|
if (!binding) return res.status(404).json({ error: "Binding not found" });
|
|
129968
130105
|
return res.json({ binding });
|
|
129969
130106
|
});
|
|
129970
|
-
|
|
130107
|
+
router16.post("/bindings", async (req, res) => {
|
|
129971
130108
|
const bindingStore = adapterManager2.getBindingStore();
|
|
129972
130109
|
if (!bindingStore) return res.status(503).json({ error: "Binding subsystem not available" });
|
|
129973
130110
|
const result2 = CreateBindingRequestSchema.safeParse(req.body);
|
|
@@ -130012,7 +130149,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
130012
130149
|
return res.status(500).json({ error: message });
|
|
130013
130150
|
}
|
|
130014
130151
|
});
|
|
130015
|
-
|
|
130152
|
+
router16.patch("/bindings/:id", async (req, res) => {
|
|
130016
130153
|
const bindingStore = adapterManager2.getBindingStore();
|
|
130017
130154
|
if (!bindingStore) {
|
|
130018
130155
|
return res.status(503).json({ error: "Binding subsystem not available" });
|
|
@@ -130058,7 +130195,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
130058
130195
|
}
|
|
130059
130196
|
return res.json({ binding: updated });
|
|
130060
130197
|
});
|
|
130061
|
-
|
|
130198
|
+
router16.delete("/bindings/:id", async (req, res) => {
|
|
130062
130199
|
const bindingStore = adapterManager2.getBindingStore();
|
|
130063
130200
|
if (!bindingStore) return res.status(503).json({ error: "Binding subsystem not available" });
|
|
130064
130201
|
const binding = bindingStore.getById(req.params.id);
|
|
@@ -130084,7 +130221,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
130084
130221
|
}
|
|
130085
130222
|
return res.json({ ok: true });
|
|
130086
130223
|
});
|
|
130087
|
-
|
|
130224
|
+
router16.post("/webhooks/:adapterId", express2.raw({ type: "*/*" }), async (req, res) => {
|
|
130088
130225
|
const adapterInfo = adapterManager2.getAdapter(req.params.adapterId);
|
|
130089
130226
|
if (!adapterInfo || adapterInfo.config.type !== "webhook") {
|
|
130090
130227
|
return res.status(404).json({ error: "Webhook adapter not found" });
|
|
@@ -130103,7 +130240,7 @@ function createAdapterRouter(adapterManager2, traceStore2) {
|
|
|
130103
130240
|
if (result2.ok) return res.status(200).json({ ok: true });
|
|
130104
130241
|
return res.status(401).json({ error: result2.error });
|
|
130105
130242
|
});
|
|
130106
|
-
return
|
|
130243
|
+
return router16;
|
|
130107
130244
|
}
|
|
130108
130245
|
|
|
130109
130246
|
// ../../apps/server/src/routes/relay.ts
|
|
@@ -130174,8 +130311,8 @@ function buildConversations(messages, deadLetters, labelMap) {
|
|
|
130174
130311
|
});
|
|
130175
130312
|
}
|
|
130176
130313
|
function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
130177
|
-
const
|
|
130178
|
-
|
|
130314
|
+
const router16 = Router20();
|
|
130315
|
+
router16.post("/messages", async (req, res) => {
|
|
130179
130316
|
const result2 = SendMessageRequestSchema2.safeParse(req.body);
|
|
130180
130317
|
if (!result2.success) {
|
|
130181
130318
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -130233,7 +130370,7 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130233
130370
|
});
|
|
130234
130371
|
}
|
|
130235
130372
|
});
|
|
130236
|
-
|
|
130373
|
+
router16.get("/messages", (_req, res) => {
|
|
130237
130374
|
const result2 = MessageListQuerySchema.safeParse(_req.query);
|
|
130238
130375
|
if (!result2.success) {
|
|
130239
130376
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -130241,7 +130378,7 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130241
130378
|
const messages = relayCore2.listMessages(result2.data);
|
|
130242
130379
|
return res.json(messages);
|
|
130243
130380
|
});
|
|
130244
|
-
|
|
130381
|
+
router16.get("/conversations", async (_req, res) => {
|
|
130245
130382
|
try {
|
|
130246
130383
|
const messages = relayCore2.listMessages({});
|
|
130247
130384
|
const deadLetters = await relayCore2.getDeadLetters();
|
|
@@ -130262,15 +130399,15 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130262
130399
|
return res.status(500).json({ error: message });
|
|
130263
130400
|
}
|
|
130264
130401
|
});
|
|
130265
|
-
|
|
130402
|
+
router16.get("/messages/:id", (_req, res) => {
|
|
130266
130403
|
const message = relayCore2.getMessage(_req.params.id);
|
|
130267
130404
|
if (!message) return res.status(404).json({ error: "Message not found" });
|
|
130268
130405
|
return res.json(message);
|
|
130269
130406
|
});
|
|
130270
|
-
|
|
130407
|
+
router16.get("/endpoints", (_req, res) => {
|
|
130271
130408
|
return res.json(relayCore2.listEndpoints());
|
|
130272
130409
|
});
|
|
130273
|
-
|
|
130410
|
+
router16.post("/endpoints", async (req, res) => {
|
|
130274
130411
|
const result2 = EndpointRegistrationSchema.safeParse(req.body);
|
|
130275
130412
|
if (!result2.success) {
|
|
130276
130413
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -130283,12 +130420,12 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130283
130420
|
return res.status(422).json({ error: message });
|
|
130284
130421
|
}
|
|
130285
130422
|
});
|
|
130286
|
-
|
|
130423
|
+
router16.delete(/^\/endpoints\/(.+)$/, async (req, res) => {
|
|
130287
130424
|
const removed = await relayCore2.unregisterEndpoint(req.params[0]);
|
|
130288
130425
|
if (!removed) return res.status(404).json({ error: "Endpoint not found" });
|
|
130289
130426
|
return res.json({ success: true });
|
|
130290
130427
|
});
|
|
130291
|
-
|
|
130428
|
+
router16.get(/^\/endpoints\/(.+)\/inbox$/, (_req, res) => {
|
|
130292
130429
|
const result2 = InboxQuerySchema.safeParse(_req.query);
|
|
130293
130430
|
if (!result2.success) {
|
|
130294
130431
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -130303,12 +130440,12 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130303
130440
|
throw err;
|
|
130304
130441
|
}
|
|
130305
130442
|
});
|
|
130306
|
-
|
|
130443
|
+
router16.get("/dead-letters", async (_req, res) => {
|
|
130307
130444
|
const endpointHash = _req.query.endpointHash;
|
|
130308
130445
|
const deadLetters = await relayCore2.getDeadLetters(endpointHash ? { endpointHash } : void 0);
|
|
130309
130446
|
return res.json(deadLetters);
|
|
130310
130447
|
});
|
|
130311
|
-
|
|
130448
|
+
router16.get("/dead-letters/aggregated", async (_req, res) => {
|
|
130312
130449
|
const deadLetters = await relayCore2.getDeadLetters();
|
|
130313
130450
|
const groups = /* @__PURE__ */ new Map();
|
|
130314
130451
|
for (const dl of deadLetters) {
|
|
@@ -130332,7 +130469,7 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130332
130469
|
}
|
|
130333
130470
|
return res.json({ groups: [...groups.values()] });
|
|
130334
130471
|
});
|
|
130335
|
-
|
|
130472
|
+
router16.delete("/dead-letters", async (req, res) => {
|
|
130336
130473
|
const { source, reason } = req.body;
|
|
130337
130474
|
if (!source || !reason) {
|
|
130338
130475
|
return res.status(400).json({ error: "source and reason are required" });
|
|
@@ -130346,19 +130483,19 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130346
130483
|
}
|
|
130347
130484
|
return res.json({ removed: toRemove.length });
|
|
130348
130485
|
});
|
|
130349
|
-
|
|
130350
|
-
|
|
130486
|
+
router16.get("/metrics", (_req, res) => res.json(relayCore2.getMetrics()));
|
|
130487
|
+
router16.get("/messages/:id/trace", (_req, res) => {
|
|
130351
130488
|
if (!traceStore2) return res.status(404).json({ error: "Tracing not available" });
|
|
130352
130489
|
const span = traceStore2.getSpanByMessageId(_req.params.id);
|
|
130353
130490
|
if (!span) return res.status(404).json({ error: "Trace not found" });
|
|
130354
130491
|
const spans = traceStore2.getTrace(span.traceId);
|
|
130355
130492
|
return res.json({ traceId: span.traceId, spans });
|
|
130356
130493
|
});
|
|
130357
|
-
|
|
130494
|
+
router16.get("/trace/metrics", (_req, res) => {
|
|
130358
130495
|
if (!traceStore2) return res.status(404).json({ error: "Tracing not available" });
|
|
130359
130496
|
return res.json(traceStore2.getMetrics());
|
|
130360
130497
|
});
|
|
130361
|
-
|
|
130498
|
+
router16.get("/stream", (req, res) => {
|
|
130362
130499
|
logger.warn("[DEPRECATED] GET /api/relay/stream \u2014 use GET /api/events instead");
|
|
130363
130500
|
const pattern = req.query.subject || "relay.human.console.>";
|
|
130364
130501
|
if (!validateSubscriptionPattern(pattern)) {
|
|
@@ -130428,9 +130565,9 @@ function createRelayRouter(relayCore2, adapterManager2, traceStore2) {
|
|
|
130428
130565
|
});
|
|
130429
130566
|
});
|
|
130430
130567
|
if (adapterManager2) {
|
|
130431
|
-
|
|
130568
|
+
router16.use("/", createAdapterRouter(adapterManager2, traceStore2));
|
|
130432
130569
|
}
|
|
130433
|
-
return
|
|
130570
|
+
return router16;
|
|
130434
130571
|
}
|
|
130435
130572
|
|
|
130436
130573
|
// ../../apps/server/src/services/relay/trace-store.ts
|
|
@@ -132175,7 +132312,7 @@ var MeshCore = class {
|
|
|
132175
132312
|
};
|
|
132176
132313
|
|
|
132177
132314
|
// ../../apps/server/src/routes/mesh.ts
|
|
132178
|
-
import { Router as
|
|
132315
|
+
import { Router as Router21 } from "express";
|
|
132179
132316
|
function enrichTopology(topology, deps) {
|
|
132180
132317
|
const scheduleCounts = /* @__PURE__ */ new Map();
|
|
132181
132318
|
if (deps.taskStore) {
|
|
@@ -132258,8 +132395,8 @@ function enrichAgent(agent, namespace, deps, scheduleCounts, relayEndpoints) {
|
|
|
132258
132395
|
function createMeshRouter(deps) {
|
|
132259
132396
|
const resolvedDeps = "meshCore" in deps ? deps : { meshCore: deps };
|
|
132260
132397
|
const meshCore2 = resolvedDeps.meshCore;
|
|
132261
|
-
const
|
|
132262
|
-
|
|
132398
|
+
const router16 = Router21();
|
|
132399
|
+
router16.post("/discover", async (req, res) => {
|
|
132263
132400
|
const result2 = DiscoverRequestSchema.safeParse(req.body);
|
|
132264
132401
|
if (!result2.success) {
|
|
132265
132402
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132290,7 +132427,7 @@ function createMeshRouter(deps) {
|
|
|
132290
132427
|
return res.status(500).json({ error: message });
|
|
132291
132428
|
}
|
|
132292
132429
|
});
|
|
132293
|
-
|
|
132430
|
+
router16.post("/agents", async (req, res) => {
|
|
132294
132431
|
const result2 = RegisterAgentRequestSchema.safeParse(req.body);
|
|
132295
132432
|
if (!result2.success) {
|
|
132296
132433
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132335,13 +132472,13 @@ function createMeshRouter(deps) {
|
|
|
132335
132472
|
return res.status(422).json({ error: message });
|
|
132336
132473
|
}
|
|
132337
132474
|
});
|
|
132338
|
-
|
|
132475
|
+
router16.get("/topology", (req, res) => {
|
|
132339
132476
|
const namespace = req.query.namespace ?? "*";
|
|
132340
132477
|
const topology = meshCore2.getTopology(namespace);
|
|
132341
132478
|
const enriched = enrichTopology(topology, resolvedDeps);
|
|
132342
132479
|
return res.json(enriched);
|
|
132343
132480
|
});
|
|
132344
|
-
|
|
132481
|
+
router16.put("/topology/access", (req, res) => {
|
|
132345
132482
|
const result2 = UpdateAccessRuleRequestSchema.safeParse(req.body);
|
|
132346
132483
|
if (!result2.success) {
|
|
132347
132484
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132354,15 +132491,15 @@ function createMeshRouter(deps) {
|
|
|
132354
132491
|
}
|
|
132355
132492
|
return res.json({ sourceNamespace, targetNamespace, action });
|
|
132356
132493
|
});
|
|
132357
|
-
|
|
132494
|
+
router16.get("/status", (_req, res) => {
|
|
132358
132495
|
const status = meshCore2.getStatus();
|
|
132359
132496
|
res.json(status);
|
|
132360
132497
|
});
|
|
132361
|
-
|
|
132498
|
+
router16.get("/agents/paths", (_req, res) => {
|
|
132362
132499
|
const agents2 = meshCore2.listWithPaths();
|
|
132363
132500
|
return res.json({ agents: agents2 });
|
|
132364
132501
|
});
|
|
132365
|
-
|
|
132502
|
+
router16.get("/agents", (req, res) => {
|
|
132366
132503
|
const result2 = AgentListQuerySchema.safeParse(req.query);
|
|
132367
132504
|
if (!result2.success) {
|
|
132368
132505
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132371,17 +132508,17 @@ function createMeshRouter(deps) {
|
|
|
132371
132508
|
const agents2 = callerNamespace ? meshCore2.list({ ...filters, callerNamespace }) : meshCore2.listWithHealth(filters);
|
|
132372
132509
|
return res.json({ agents: agents2 });
|
|
132373
132510
|
});
|
|
132374
|
-
|
|
132511
|
+
router16.get("/agents/:id/access", (req, res) => {
|
|
132375
132512
|
const agents2 = meshCore2.getAgentAccess(req.params.id);
|
|
132376
132513
|
if (!agents2) return res.status(404).json({ error: "Agent not found" });
|
|
132377
132514
|
return res.json({ agents: agents2 });
|
|
132378
132515
|
});
|
|
132379
|
-
|
|
132516
|
+
router16.get("/agents/:id/health", (req, res) => {
|
|
132380
132517
|
const health = meshCore2.getAgentHealth(req.params.id);
|
|
132381
132518
|
if (!health) return res.status(404).json({ error: "Agent not found" });
|
|
132382
132519
|
return res.json(health);
|
|
132383
132520
|
});
|
|
132384
|
-
|
|
132521
|
+
router16.post("/agents/:id/heartbeat", async (req, res) => {
|
|
132385
132522
|
const parsed = HeartbeatRequestSchema.safeParse(req.body ?? {});
|
|
132386
132523
|
const event = parsed.success ? parsed.data.event ?? "heartbeat" : "heartbeat";
|
|
132387
132524
|
const healthBefore = meshCore2.getAgentHealth(req.params.id);
|
|
@@ -132407,14 +132544,14 @@ function createMeshRouter(deps) {
|
|
|
132407
132544
|
}
|
|
132408
132545
|
return res.json({ success: true });
|
|
132409
132546
|
});
|
|
132410
|
-
|
|
132547
|
+
router16.get("/agents/:id", (req, res) => {
|
|
132411
132548
|
const agent = meshCore2.get(req.params.id);
|
|
132412
132549
|
if (!agent) {
|
|
132413
132550
|
return res.status(404).json({ error: "Agent not found" });
|
|
132414
132551
|
}
|
|
132415
132552
|
return res.json(agent);
|
|
132416
132553
|
});
|
|
132417
|
-
|
|
132554
|
+
router16.patch("/agents/:id", async (req, res) => {
|
|
132418
132555
|
const result2 = UpdateAgentRequestSchema.safeParse(req.body);
|
|
132419
132556
|
if (!result2.success) {
|
|
132420
132557
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132438,7 +132575,7 @@ function createMeshRouter(deps) {
|
|
|
132438
132575
|
}
|
|
132439
132576
|
return res.json(updated);
|
|
132440
132577
|
});
|
|
132441
|
-
|
|
132578
|
+
router16.delete("/agents/:id", async (req, res) => {
|
|
132442
132579
|
const agent = meshCore2.get(req.params.id);
|
|
132443
132580
|
if (!agent) {
|
|
132444
132581
|
return res.status(404).json({ error: "Agent not found" });
|
|
@@ -132462,7 +132599,7 @@ function createMeshRouter(deps) {
|
|
|
132462
132599
|
}
|
|
132463
132600
|
return res.json({ success: true });
|
|
132464
132601
|
});
|
|
132465
|
-
|
|
132602
|
+
router16.post("/deny", async (req, res) => {
|
|
132466
132603
|
const result2 = DenyRequestSchema.safeParse(req.body);
|
|
132467
132604
|
if (!result2.success) {
|
|
132468
132605
|
return res.status(400).json({ error: "Validation failed", details: result2.error.flatten() });
|
|
@@ -132481,11 +132618,11 @@ function createMeshRouter(deps) {
|
|
|
132481
132618
|
return res.status(422).json({ error: message });
|
|
132482
132619
|
}
|
|
132483
132620
|
});
|
|
132484
|
-
|
|
132621
|
+
router16.get("/denied", (_req, res) => {
|
|
132485
132622
|
const denied = meshCore2.listDenied();
|
|
132486
132623
|
return res.json({ denied });
|
|
132487
132624
|
});
|
|
132488
|
-
|
|
132625
|
+
router16.delete("/denied/:encodedPath", async (req, res) => {
|
|
132489
132626
|
const filePath = decodeURIComponent(req.params.encodedPath);
|
|
132490
132627
|
if (filePath.includes("..") || filePath.includes("\0")) {
|
|
132491
132628
|
return res.status(400).json({ error: "Invalid path" });
|
|
@@ -132499,7 +132636,7 @@ function createMeshRouter(deps) {
|
|
|
132499
132636
|
await meshCore2.undeny(resolvedPath);
|
|
132500
132637
|
return res.json({ success: true });
|
|
132501
132638
|
});
|
|
132502
|
-
return
|
|
132639
|
+
return router16;
|
|
132503
132640
|
}
|
|
132504
132641
|
|
|
132505
132642
|
// ../../apps/server/src/services/mesh/ensure-dorkbot.ts
|
|
@@ -132554,7 +132691,7 @@ async function ensureDorkBot(meshCore2, dorkHome) {
|
|
|
132554
132691
|
}
|
|
132555
132692
|
|
|
132556
132693
|
// ../../apps/server/src/routes/a2a.ts
|
|
132557
|
-
import { Router as
|
|
132694
|
+
import { Router as Router22 } from "express";
|
|
132558
132695
|
|
|
132559
132696
|
// ../a2a-gateway/dist/agent-card-generator.js
|
|
132560
132697
|
var DEFAULT_INPUT_MODES = ["text/plain"];
|
|
@@ -134187,9 +134324,9 @@ import express22 from "express";
|
|
|
134187
134324
|
import express42 from "express";
|
|
134188
134325
|
function jsonRpcHandler(options) {
|
|
134189
134326
|
const jsonRpcTransportHandler = new JsonRpcTransportHandler(options.requestHandler);
|
|
134190
|
-
const
|
|
134191
|
-
|
|
134192
|
-
|
|
134327
|
+
const router16 = express4.Router();
|
|
134328
|
+
router16.use(express4.json(), jsonErrorHandler);
|
|
134329
|
+
router16.post("/", async (req, res) => {
|
|
134193
134330
|
try {
|
|
134194
134331
|
const user = await options.userBuilder(req);
|
|
134195
134332
|
const context = new ServerCallContext(
|
|
@@ -134255,7 +134392,7 @@ function jsonRpcHandler(options) {
|
|
|
134255
134392
|
}
|
|
134256
134393
|
}
|
|
134257
134394
|
});
|
|
134258
|
-
return
|
|
134395
|
+
return router16;
|
|
134259
134396
|
}
|
|
134260
134397
|
var jsonErrorHandler = (err, _req, res, next) => {
|
|
134261
134398
|
if (err instanceof SyntaxError && "body" in err) {
|
|
@@ -134308,7 +134445,7 @@ function createA2aHandlers(deps) {
|
|
|
134308
134445
|
|
|
134309
134446
|
// ../../apps/server/src/routes/a2a.ts
|
|
134310
134447
|
function createA2aRouter(deps) {
|
|
134311
|
-
const
|
|
134448
|
+
const router16 = Router22();
|
|
134312
134449
|
const config = { baseUrl: deps.baseUrl, version: deps.version };
|
|
134313
134450
|
const handlers = createA2aHandlers({
|
|
134314
134451
|
agentRegistry: deps.meshCore,
|
|
@@ -134316,18 +134453,18 @@ function createA2aRouter(deps) {
|
|
|
134316
134453
|
db: deps.db,
|
|
134317
134454
|
config
|
|
134318
134455
|
});
|
|
134319
|
-
|
|
134320
|
-
|
|
134321
|
-
return { router:
|
|
134456
|
+
router16.get("/agents/:id/card", handlers.agentCard);
|
|
134457
|
+
router16.post("/", handlers.jsonRpc);
|
|
134458
|
+
return { router: router16, fleetCardHandler: handlers.fleetCard };
|
|
134322
134459
|
}
|
|
134323
134460
|
|
|
134324
134461
|
// ../../apps/server/src/routes/agents.ts
|
|
134325
|
-
import { Router as
|
|
134462
|
+
import { Router as Router23 } from "express";
|
|
134326
134463
|
import path41 from "path";
|
|
134327
134464
|
init_logger();
|
|
134328
134465
|
function createAgentsRouter(meshCore2) {
|
|
134329
|
-
const
|
|
134330
|
-
|
|
134466
|
+
const router16 = Router23();
|
|
134467
|
+
router16.get("/current", async (req, res) => {
|
|
134331
134468
|
try {
|
|
134332
134469
|
const rawPath = req.query.path;
|
|
134333
134470
|
if (!rawPath) {
|
|
@@ -134349,7 +134486,7 @@ function createAgentsRouter(meshCore2) {
|
|
|
134349
134486
|
return res.status(500).json({ error: "Internal server error" });
|
|
134350
134487
|
}
|
|
134351
134488
|
});
|
|
134352
|
-
|
|
134489
|
+
router16.post("/resolve", async (req, res) => {
|
|
134353
134490
|
try {
|
|
134354
134491
|
const result2 = ResolveAgentsRequestSchema.safeParse(req.body);
|
|
134355
134492
|
if (!result2.success) {
|
|
@@ -134372,7 +134509,7 @@ function createAgentsRouter(meshCore2) {
|
|
|
134372
134509
|
return res.status(500).json({ error: "Internal server error" });
|
|
134373
134510
|
}
|
|
134374
134511
|
});
|
|
134375
|
-
|
|
134512
|
+
router16.post("/", async (req, res) => {
|
|
134376
134513
|
try {
|
|
134377
134514
|
const result2 = CreateAgentRequestSchema.safeParse(req.body);
|
|
134378
134515
|
if (!result2.success) {
|
|
@@ -134431,7 +134568,7 @@ function createAgentsRouter(meshCore2) {
|
|
|
134431
134568
|
return res.status(500).json({ error: "Internal server error" });
|
|
134432
134569
|
}
|
|
134433
134570
|
});
|
|
134434
|
-
|
|
134571
|
+
router16.post("/create", async (req, res) => {
|
|
134435
134572
|
try {
|
|
134436
134573
|
const result2 = await createAgentWorkspace(req.body, meshCore2);
|
|
134437
134574
|
const activityService = req.app.locals.activityService;
|
|
@@ -134466,7 +134603,7 @@ function createAgentsRouter(meshCore2) {
|
|
|
134466
134603
|
return res.status(500).json({ error: "Internal server error" });
|
|
134467
134604
|
}
|
|
134468
134605
|
});
|
|
134469
|
-
|
|
134606
|
+
router16.patch("/current", async (req, res) => {
|
|
134470
134607
|
try {
|
|
134471
134608
|
const rawPath = req.query.path;
|
|
134472
134609
|
if (!rawPath) {
|
|
@@ -134513,7 +134650,7 @@ function createAgentsRouter(meshCore2) {
|
|
|
134513
134650
|
return res.status(500).json({ error: "Internal server error" });
|
|
134514
134651
|
}
|
|
134515
134652
|
});
|
|
134516
|
-
|
|
134653
|
+
router16.post("/current/migrate-persona", async (req, res) => {
|
|
134517
134654
|
try {
|
|
134518
134655
|
const rawPath = req.query.path;
|
|
134519
134656
|
if (!rawPath) {
|
|
@@ -134549,11 +134686,11 @@ function createAgentsRouter(meshCore2) {
|
|
|
134549
134686
|
return res.status(500).json({ error: "Internal server error" });
|
|
134550
134687
|
}
|
|
134551
134688
|
});
|
|
134552
|
-
return
|
|
134689
|
+
return router16;
|
|
134553
134690
|
}
|
|
134554
134691
|
|
|
134555
134692
|
// ../../apps/server/src/routes/discovery.ts
|
|
134556
|
-
import { Router as
|
|
134693
|
+
import { Router as Router24 } from "express";
|
|
134557
134694
|
import { z as z37 } from "zod";
|
|
134558
134695
|
init_logger();
|
|
134559
134696
|
var ScanRequestSchema = z37.object({
|
|
@@ -134563,8 +134700,8 @@ var ScanRequestSchema = z37.object({
|
|
|
134563
134700
|
timeout: z37.number().int().min(1e3).max(12e4).optional()
|
|
134564
134701
|
});
|
|
134565
134702
|
function createDiscoveryRouter(meshCore2) {
|
|
134566
|
-
const
|
|
134567
|
-
|
|
134703
|
+
const router16 = Router24();
|
|
134704
|
+
router16.post("/scan", async (req, res) => {
|
|
134568
134705
|
const data = parseBody(ScanRequestSchema, req.body, res);
|
|
134569
134706
|
if (!data) return;
|
|
134570
134707
|
const roots = data.roots && data.roots.length > 0 ? data.roots : data.root ? [data.root] : [getBoundary()];
|
|
@@ -134651,11 +134788,11 @@ function createDiscoveryRouter(meshCore2) {
|
|
|
134651
134788
|
}
|
|
134652
134789
|
}
|
|
134653
134790
|
});
|
|
134654
|
-
return
|
|
134791
|
+
return router16;
|
|
134655
134792
|
}
|
|
134656
134793
|
|
|
134657
134794
|
// ../../apps/server/src/routes/templates.ts
|
|
134658
|
-
import { Router as
|
|
134795
|
+
import { Router as Router25 } from "express";
|
|
134659
134796
|
import fs25 from "fs/promises";
|
|
134660
134797
|
import path42 from "path";
|
|
134661
134798
|
|
|
@@ -134782,9 +134919,9 @@ async function writeUserTemplates(catalogPath, templates) {
|
|
|
134782
134919
|
await fs25.writeFile(catalogPath, JSON.stringify(catalog, null, 2), "utf-8");
|
|
134783
134920
|
}
|
|
134784
134921
|
function createTemplateRouter(dorkHome) {
|
|
134785
|
-
const
|
|
134922
|
+
const router16 = Router25();
|
|
134786
134923
|
const catalogPath = path42.join(dorkHome, USER_CATALOG_FILENAME);
|
|
134787
|
-
|
|
134924
|
+
router16.get("/", async (_req, res) => {
|
|
134788
134925
|
try {
|
|
134789
134926
|
const userTemplates = await readUserTemplates(catalogPath);
|
|
134790
134927
|
const templates = [...DEFAULT_TEMPLATES2, ...userTemplates];
|
|
@@ -134794,7 +134931,7 @@ function createTemplateRouter(dorkHome) {
|
|
|
134794
134931
|
return res.status(500).json({ error: "Internal server error" });
|
|
134795
134932
|
}
|
|
134796
134933
|
});
|
|
134797
|
-
|
|
134934
|
+
router16.post("/", async (req, res) => {
|
|
134798
134935
|
try {
|
|
134799
134936
|
const result2 = TemplateEntrySchema.safeParse({ ...req.body, builtin: false });
|
|
134800
134937
|
if (!result2.success) {
|
|
@@ -134818,7 +134955,7 @@ function createTemplateRouter(dorkHome) {
|
|
|
134818
134955
|
return res.status(500).json({ error: "Internal server error" });
|
|
134819
134956
|
}
|
|
134820
134957
|
});
|
|
134821
|
-
|
|
134958
|
+
router16.delete("/:id", async (req, res) => {
|
|
134822
134959
|
try {
|
|
134823
134960
|
const { id } = req.params;
|
|
134824
134961
|
const isBuiltin = DEFAULT_TEMPLATES2.some((t4) => t4.id === id);
|
|
@@ -134838,11 +134975,11 @@ function createTemplateRouter(dorkHome) {
|
|
|
134838
134975
|
return res.status(500).json({ error: "Internal server error" });
|
|
134839
134976
|
}
|
|
134840
134977
|
});
|
|
134841
|
-
return
|
|
134978
|
+
return router16;
|
|
134842
134979
|
}
|
|
134843
134980
|
|
|
134844
134981
|
// ../../apps/server/src/routes/admin.ts
|
|
134845
|
-
import { Router as
|
|
134982
|
+
import { Router as Router26 } from "express";
|
|
134846
134983
|
import { spawn as spawn3 } from "child_process";
|
|
134847
134984
|
import fs26 from "fs/promises";
|
|
134848
134985
|
init_env();
|
|
@@ -134861,15 +134998,15 @@ function triggerRestart() {
|
|
|
134861
134998
|
}
|
|
134862
134999
|
}
|
|
134863
135000
|
function createAdminRouter(deps) {
|
|
134864
|
-
const
|
|
135001
|
+
const router16 = Router26();
|
|
134865
135002
|
const adminLimiter = rate_limit_default({
|
|
134866
135003
|
windowMs: 5 * 60 * 1e3,
|
|
134867
135004
|
// 5 minutes
|
|
134868
135005
|
max: 3,
|
|
134869
135006
|
message: { error: "Too many admin requests. Try again later." }
|
|
134870
135007
|
});
|
|
134871
|
-
|
|
134872
|
-
|
|
135008
|
+
router16.use(adminLimiter);
|
|
135009
|
+
router16.post("/reset", (req, res) => {
|
|
134873
135010
|
const { confirm } = req.body ?? {};
|
|
134874
135011
|
if (confirm !== "reset") {
|
|
134875
135012
|
res.status(400).json({
|
|
@@ -134888,7 +135025,7 @@ function createAdminRouter(deps) {
|
|
|
134888
135025
|
triggerRestart();
|
|
134889
135026
|
});
|
|
134890
135027
|
});
|
|
134891
|
-
|
|
135028
|
+
router16.post("/restart", (_req, res) => {
|
|
134892
135029
|
res.status(200).json({ message: "Restart initiated." });
|
|
134893
135030
|
setImmediate(async () => {
|
|
134894
135031
|
try {
|
|
@@ -134898,7 +135035,7 @@ function createAdminRouter(deps) {
|
|
|
134898
135035
|
triggerRestart();
|
|
134899
135036
|
});
|
|
134900
135037
|
});
|
|
134901
|
-
return
|
|
135038
|
+
return router16;
|
|
134902
135039
|
}
|
|
134903
135040
|
|
|
134904
135041
|
// ../../apps/server/src/services/extensions/extension-discovery.ts
|
|
@@ -135476,10 +135613,10 @@ var ExtensionCompiler = class {
|
|
|
135476
135613
|
import fs30 from "fs/promises";
|
|
135477
135614
|
import path46 from "path";
|
|
135478
135615
|
import { createRequire as createRequire2 } from "node:module";
|
|
135479
|
-
import { Router as
|
|
135616
|
+
import { Router as Router28 } from "express";
|
|
135480
135617
|
|
|
135481
135618
|
// ../../apps/server/src/services/extensions/extension-proxy.ts
|
|
135482
|
-
import { Router as
|
|
135619
|
+
import { Router as Router27 } from "express";
|
|
135483
135620
|
init_logger();
|
|
135484
135621
|
var STRIPPED_HEADERS = /* @__PURE__ */ new Set([
|
|
135485
135622
|
"host",
|
|
@@ -135503,9 +135640,9 @@ function formatAuthValue(authType, secret) {
|
|
|
135503
135640
|
return authType === "Custom" ? secret : `${authType} ${secret}`;
|
|
135504
135641
|
}
|
|
135505
135642
|
function createProxyRouter(extensionId, config, dorkHome) {
|
|
135506
|
-
const
|
|
135643
|
+
const router16 = Router27();
|
|
135507
135644
|
const secrets = new ExtensionSecretStore(extensionId, dorkHome);
|
|
135508
|
-
|
|
135645
|
+
router16.all("/proxy/*", async (req, res) => {
|
|
135509
135646
|
const targetPath = req.params[0] || "";
|
|
135510
135647
|
let targetUrl = `${config.baseUrl.replace(/\/+$/, "")}/${targetPath}`;
|
|
135511
135648
|
if (config.pathRewrite) {
|
|
@@ -135549,7 +135686,7 @@ function createProxyRouter(extensionId, config, dorkHome) {
|
|
|
135549
135686
|
});
|
|
135550
135687
|
}
|
|
135551
135688
|
});
|
|
135552
|
-
return
|
|
135689
|
+
return router16;
|
|
135553
135690
|
}
|
|
135554
135691
|
|
|
135555
135692
|
// ../../apps/server/src/services/extensions/extension-server-api-factory.ts
|
|
@@ -135659,21 +135796,21 @@ var ExtensionServerLifecycle = class {
|
|
|
135659
135796
|
if (typeof registerFn !== "function") {
|
|
135660
135797
|
return { ok: false, error: "Server entry does not export a register function" };
|
|
135661
135798
|
}
|
|
135662
|
-
const
|
|
135799
|
+
const router16 = Router28();
|
|
135663
135800
|
const { ctx, getScheduledCleanups } = createDataProviderContext({
|
|
135664
135801
|
extensionId: id,
|
|
135665
135802
|
extensionDir: record2.path,
|
|
135666
135803
|
dorkHome: this.dorkHome
|
|
135667
135804
|
});
|
|
135668
|
-
const result2 = await registerFn(
|
|
135805
|
+
const result2 = await registerFn(router16, ctx);
|
|
135669
135806
|
const cleanup = typeof result2 === "function" ? result2 : null;
|
|
135670
135807
|
if (record2.hasDataProxy && record2.manifest.dataProxy) {
|
|
135671
135808
|
const proxyRouter = createProxyRouter(id, record2.manifest.dataProxy, this.dorkHome);
|
|
135672
|
-
|
|
135809
|
+
router16.use(proxyRouter);
|
|
135673
135810
|
}
|
|
135674
135811
|
this.serverExtensions.set(id, {
|
|
135675
135812
|
extensionId: id,
|
|
135676
|
-
router:
|
|
135813
|
+
router: router16,
|
|
135677
135814
|
cleanup,
|
|
135678
135815
|
scheduledCleanups: getScheduledCleanups()
|
|
135679
135816
|
});
|
|
@@ -136570,7 +136707,7 @@ var ActivityService = class {
|
|
|
136570
136707
|
};
|
|
136571
136708
|
|
|
136572
136709
|
// ../../apps/server/src/routes/activity.ts
|
|
136573
|
-
import { Router as
|
|
136710
|
+
import { Router as Router29 } from "express";
|
|
136574
136711
|
|
|
136575
136712
|
// ../shared/dist/activity-schemas.js
|
|
136576
136713
|
import { z as z40 } from "zod";
|
|
@@ -136611,8 +136748,8 @@ var ListActivityResponseSchema = z40.object({
|
|
|
136611
136748
|
|
|
136612
136749
|
// ../../apps/server/src/routes/activity.ts
|
|
136613
136750
|
function createActivityRouter(activityService) {
|
|
136614
|
-
const
|
|
136615
|
-
|
|
136751
|
+
const router16 = Router29();
|
|
136752
|
+
router16.get("/", async (req, res) => {
|
|
136616
136753
|
const query2 = parseBody(ListActivityQuerySchema, req.query, res);
|
|
136617
136754
|
if (!query2) return;
|
|
136618
136755
|
try {
|
|
@@ -136622,7 +136759,7 @@ function createActivityRouter(activityService) {
|
|
|
136622
136759
|
return res.status(500).json({ error: "Failed to fetch activity events" });
|
|
136623
136760
|
}
|
|
136624
136761
|
});
|
|
136625
|
-
return
|
|
136762
|
+
return router16;
|
|
136626
136763
|
}
|
|
136627
136764
|
|
|
136628
136765
|
// ../../apps/server/src/middleware/extension-routes.ts
|
|
@@ -136633,12 +136770,12 @@ function createExtensionRoutesMiddleware(extensionManager2) {
|
|
|
136633
136770
|
res.status(400).json({ error: "Missing extension ID" });
|
|
136634
136771
|
return;
|
|
136635
136772
|
}
|
|
136636
|
-
const
|
|
136637
|
-
if (!
|
|
136773
|
+
const router16 = extensionManager2.getServerRouter(id);
|
|
136774
|
+
if (!router16) {
|
|
136638
136775
|
res.status(404).json({ error: `Extension '${id}' has no server routes` });
|
|
136639
136776
|
return;
|
|
136640
136777
|
}
|
|
136641
|
-
|
|
136778
|
+
router16(req, res, next);
|
|
136642
136779
|
};
|
|
136643
136780
|
}
|
|
136644
136781
|
|
|
@@ -142567,7 +142704,7 @@ function createExternalMcpServer(deps) {
|
|
|
142567
142704
|
}
|
|
142568
142705
|
|
|
142569
142706
|
// ../../apps/server/src/routes/mcp.ts
|
|
142570
|
-
import { Router as
|
|
142707
|
+
import { Router as Router30 } from "express";
|
|
142571
142708
|
|
|
142572
142709
|
// ../../node_modules/.pnpm/@hono+node-server@1.19.12_hono@4.12.9/node_modules/@hono/node-server/dist/index.mjs
|
|
142573
142710
|
import { Http2ServerRequest as Http2ServerRequest2, constants as h2constants } from "http2";
|
|
@@ -143875,8 +144012,8 @@ var StreamableHTTPServerTransport = class {
|
|
|
143875
144012
|
// ../../apps/server/src/routes/mcp.ts
|
|
143876
144013
|
init_logger();
|
|
143877
144014
|
function createMcpRouter(serverFactory) {
|
|
143878
|
-
const
|
|
143879
|
-
|
|
144015
|
+
const router16 = Router30();
|
|
144016
|
+
router16.post("/", async (req, res) => {
|
|
143880
144017
|
try {
|
|
143881
144018
|
const server = serverFactory();
|
|
143882
144019
|
const transport = new StreamableHTTPServerTransport({
|
|
@@ -143902,7 +144039,7 @@ function createMcpRouter(serverFactory) {
|
|
|
143902
144039
|
}
|
|
143903
144040
|
}
|
|
143904
144041
|
});
|
|
143905
|
-
|
|
144042
|
+
router16.get("/", (_req, res) => {
|
|
143906
144043
|
res.status(405).json({
|
|
143907
144044
|
jsonrpc: "2.0",
|
|
143908
144045
|
error: {
|
|
@@ -143912,7 +144049,7 @@ function createMcpRouter(serverFactory) {
|
|
|
143912
144049
|
id: null
|
|
143913
144050
|
});
|
|
143914
144051
|
});
|
|
143915
|
-
|
|
144052
|
+
router16.delete("/", (_req, res) => {
|
|
143916
144053
|
res.status(405).json({
|
|
143917
144054
|
jsonrpc: "2.0",
|
|
143918
144055
|
error: {
|
|
@@ -143922,7 +144059,7 @@ function createMcpRouter(serverFactory) {
|
|
|
143922
144059
|
id: null
|
|
143923
144060
|
});
|
|
143924
144061
|
});
|
|
143925
|
-
return
|
|
144062
|
+
return router16;
|
|
143926
144063
|
}
|
|
143927
144064
|
|
|
143928
144065
|
// ../../apps/server/src/middleware/mcp-auth.ts
|