@neat.is/core 0.6.2 → 0.6.3-dev.20260726

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.
@@ -31,13 +31,13 @@ import {
31
31
  touchLastSeen,
32
32
  upsertObservedEdge,
33
33
  writeAtomically
34
- } from "./chunk-AOWANF2K.js";
34
+ } from "./chunk-L64CATKE.js";
35
35
  import {
36
36
  assertBindAuthority,
37
37
  buildOtelReceiver,
38
38
  listenSteppingOtlp,
39
39
  readAuthEnv
40
- } from "./chunk-2MAGU6RB.js";
40
+ } from "./chunk-ZLAZ7PLC.js";
41
41
 
42
42
  // src/daemon.ts
43
43
  import {
@@ -2132,7 +2132,7 @@ function routeSpanToProject(serviceName, projects) {
2132
2132
  if (!serviceName) return DEFAULT_PROJECT;
2133
2133
  for (const entry of projects) {
2134
2134
  if (entry.status === "paused") continue;
2135
- if (entry.name === serviceName) return entry.name;
2135
+ if (entry.name.toLowerCase() === serviceName.toLowerCase()) return entry.name;
2136
2136
  }
2137
2137
  const candidates = [];
2138
2138
  for (const entry of projects) {
@@ -2150,18 +2150,22 @@ function routeSpanToProject(serviceName, projects) {
2150
2150
  return DEFAULT_PROJECT;
2151
2151
  }
2152
2152
  function isTokenPrefix(prefix, full) {
2153
- if (prefix.length >= full.length) return false;
2154
- if (!full.startsWith(prefix)) return false;
2155
- const sep = full.charAt(prefix.length);
2153
+ const p = prefix.toLowerCase();
2154
+ const f = full.toLowerCase();
2155
+ if (p.length >= f.length) return false;
2156
+ if (!f.startsWith(p)) return false;
2157
+ const sep = f.charAt(p.length);
2156
2158
  return sep === "-" || sep === "_";
2157
2159
  }
2158
2160
  function isTokenContained(needle, haystack) {
2159
- if (!haystack.includes(needle)) return false;
2160
- const tokens = haystack.split(/[-_]/);
2161
- return tokens.includes(needle);
2161
+ const n = needle.toLowerCase();
2162
+ const h = haystack.toLowerCase();
2163
+ if (!h.includes(n)) return false;
2164
+ const tokens = h.split(/[-_]/);
2165
+ return tokens.includes(n);
2162
2166
  }
2163
2167
  function serviceNameMatchesProject(serviceName, project) {
2164
- if (serviceName === project) return true;
2168
+ if (serviceName.toLowerCase() === project.toLowerCase()) return true;
2165
2169
  if (isTokenPrefix(project, serviceName)) return true;
2166
2170
  if (isTokenContained(project, serviceName)) return true;
2167
2171
  return false;
@@ -2618,7 +2622,12 @@ async function startDaemon(opts = {}) {
2618
2622
  const slot = await resolveSlotByName(project, span.service, span.traceId);
2619
2623
  if (!slot) return;
2620
2624
  await makeErrorSpanWriter(slot.paths.errorsPath, slot.graph, slot.entry.path)(span);
2621
- }
2625
+ },
2626
+ // #881 — 404 a project-scoped POST for a project this daemon doesn't
2627
+ // host, rather than accepting it and dropping the batch. `slots` covers
2628
+ // active/recovering projects, `bootstrapStatus` the ones still
2629
+ // extracting; a foreign or wrong-cased project name matches neither.
2630
+ isProjectRegistered: (project) => slots.has(project) || bootstrapStatus.has(project)
2622
2631
  });
2623
2632
  otlpAddress = await listenSteppingOtlp(otlpApp, otlpPort, host);
2624
2633
  console.log(`neatd: OTLP listening on ${otlpAddress}/v1/traces`);
@@ -2798,4 +2807,4 @@ export {
2798
2807
  resolveHost,
2799
2808
  startDaemon
2800
2809
  };
2801
- //# sourceMappingURL=chunk-MSZ4NALT.js.map
2810
+ //# sourceMappingURL=chunk-PWIT35Z4.js.map