dorkos 0.29.0 → 0.30.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.
@@ -15,7 +15,7 @@
15
15
  if (dark) document.documentElement.classList.add('dark');
16
16
  })();
17
17
  </script>
18
- <script type="module" crossorigin src="/assets/index-C6kLRUkB.js"></script>
18
+ <script type="module" crossorigin src="/assets/index-PgrCLMKB.js"></script>
19
19
  <link rel="stylesheet" crossorigin href="/assets/index-BjpAuMmK.css">
20
20
  </head>
21
21
  <body>
@@ -82923,7 +82923,7 @@ var SERVER_VERSION = resolveVersion();
82923
82923
  var IS_DEV_BUILD = checkDevBuild(SERVER_VERSION);
82924
82924
  function resolveVersion() {
82925
82925
  if (env.DORKOS_VERSION_OVERRIDE) return env.DORKOS_VERSION_OVERRIDE;
82926
- if (true) return "0.29.0";
82926
+ if (true) return "0.30.0";
82927
82927
  const pkgPath = path5.join(path5.dirname(fileURLToPath2(import.meta.url)), "../../package.json");
82928
82928
  return JSON.parse(readFileSync(pkgPath, "utf-8")).version;
82929
82929
  }
@@ -130470,6 +130470,13 @@ async function* unifiedScan(options, strategies, registry2, denialList) {
130470
130470
  const followSymlinks = options.followSymlinks ?? false;
130471
130471
  const extraExcludes = new Set(options.extraExcludes ?? []);
130472
130472
  const { logger: logger3 } = options;
130473
+ logger3?.info("[mesh] unified-scanner: starting", {
130474
+ root: options.root,
130475
+ maxDepth,
130476
+ timeoutMs,
130477
+ followSymlinks,
130478
+ strategyCount: strategies.length
130479
+ });
130473
130480
  const progress = { scannedDirs: 0, foundAgents: 0 };
130474
130481
  let timedOut = false;
130475
130482
  const timer = setTimeout(() => {
@@ -130480,6 +130487,7 @@ async function* unifiedScan(options, strategies, registry2, denialList) {
130480
130487
  try {
130481
130488
  while (queue2.length > 0) {
130482
130489
  if (timedOut) {
130490
+ logger3?.info("[mesh] unified-scanner: timed out", progress);
130483
130491
  yield { type: "complete", data: { ...progress, timedOut: true } };
130484
130492
  return;
130485
130493
  }
@@ -130560,6 +130568,7 @@ async function* unifiedScan(options, strategies, registry2, denialList) {
130560
130568
  }
130561
130569
  }
130562
130570
  }
130571
+ logger3?.info("[mesh] unified-scanner: finished", progress);
130563
130572
  yield { type: "complete", data: { ...progress, timedOut: false } };
130564
130573
  } finally {
130565
130574
  clearTimeout(timer);
@@ -133421,6 +133430,7 @@ function createAgentsRouter(meshCore2) {
133421
133430
  // ../../apps/server/src/routes/discovery.ts
133422
133431
  import { Router as Router23 } from "express";
133423
133432
  import { z as z33 } from "zod";
133433
+ init_logger();
133424
133434
  var ScanRequestSchema = z33.object({
133425
133435
  root: z33.string().optional(),
133426
133436
  roots: z33.array(z33.string()).optional(),
@@ -133433,9 +133443,15 @@ function createDiscoveryRouter(meshCore2) {
133433
133443
  const data = parseBody(ScanRequestSchema, req.body, res);
133434
133444
  if (!data) return;
133435
133445
  const roots = data.roots && data.roots.length > 0 ? data.roots : data.root ? [data.root] : [getBoundary()];
133446
+ logger.info("[Discovery] Scan starting", {
133447
+ roots,
133448
+ maxDepth: data.maxDepth ?? 5,
133449
+ timeout: data.timeout ?? 3e4
133450
+ });
133436
133451
  for (const root3 of roots) {
133437
133452
  const withinBoundary = await isWithinBoundary(root3);
133438
133453
  if (!withinBoundary) {
133454
+ logger.warn("[Discovery] Root rejected \u2014 outside boundary", { root: root3 });
133439
133455
  return res.status(403).json({ error: `Root path outside directory boundary` });
133440
133456
  }
133441
133457
  }
@@ -133445,13 +133461,42 @@ function createDiscoveryRouter(meshCore2) {
133445
133461
  Connection: "keep-alive",
133446
133462
  "X-Accel-Buffering": "no"
133447
133463
  });
133464
+ const startMs = Date.now();
133465
+ let candidateCount = 0;
133466
+ let autoImportCount = 0;
133448
133467
  try {
133449
133468
  for await (const event of meshCore2.discover(roots, {
133450
133469
  maxDepth: data.maxDepth,
133451
133470
  timeout: data.timeout
133452
133471
  })) {
133453
133472
  if (res.writableEnded) break;
133454
- if (event.type === "auto-import") continue;
133473
+ if (event.type === "auto-import") {
133474
+ autoImportCount++;
133475
+ const { manifest, path: agentPath } = event.data;
133476
+ const existing = {
133477
+ path: agentPath,
133478
+ name: manifest.name,
133479
+ runtime: manifest.runtime,
133480
+ description: manifest.description ?? ""
133481
+ };
133482
+ logger.debug("[Discovery] Auto-imported agent surfaced as existing-agent", {
133483
+ path: agentPath,
133484
+ name: manifest.name
133485
+ });
133486
+ res.write(`event: existing-agent
133487
+ `);
133488
+ res.write(`data: ${JSON.stringify(existing)}
133489
+
133490
+ `);
133491
+ continue;
133492
+ }
133493
+ if (event.type === "candidate") {
133494
+ candidateCount++;
133495
+ logger.debug("[Discovery] Candidate found", {
133496
+ path: event.data.path,
133497
+ strategy: event.data.strategy
133498
+ });
133499
+ }
133455
133500
  res.write(`event: ${event.type}
133456
133501
  `);
133457
133502
  res.write(`data: ${JSON.stringify(event.data)}
@@ -133459,8 +133504,9 @@ function createDiscoveryRouter(meshCore2) {
133459
133504
  `);
133460
133505
  }
133461
133506
  } catch (err) {
133507
+ const message = err instanceof Error ? err.message : "Scan failed";
133508
+ logger.error("[Discovery] Scan error", { error: message });
133462
133509
  if (!res.writableEnded) {
133463
- const message = err instanceof Error ? err.message : "Scan failed";
133464
133510
  res.write(`event: error
133465
133511
  `);
133466
133512
  res.write(`data: ${JSON.stringify({ error: message })}
@@ -133468,6 +133514,13 @@ function createDiscoveryRouter(meshCore2) {
133468
133514
  `);
133469
133515
  }
133470
133516
  } finally {
133517
+ const elapsedMs = Date.now() - startMs;
133518
+ logger.info("[Discovery] Scan complete", {
133519
+ elapsedMs,
133520
+ candidateCount,
133521
+ autoImportCount,
133522
+ roots
133523
+ });
133471
133524
  if (!res.writableEnded) {
133472
133525
  res.end();
133473
133526
  }