@arcote.tech/arc-cli 0.7.6 → 0.7.7

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.
@@ -600,7 +600,25 @@ export async function startPlatformServer(
600
600
  // Context available — use createArcServer with platform handlers on top.
601
601
  // `resolveDbAdapterFactory` picks SQLite or Postgres based on DATABASE_URL.
602
602
  const dbPath = opts.dbPath || join(ws.arcDir, "data", "arc.db");
603
- const dbAdapterFactory = await resolveDbAdapterFactory(dbPath);
603
+ const baseDbFactory = await resolveDbAdapterFactory(dbPath);
604
+
605
+ // Wrap the DB adapter for per-transaction spans when telemetry is on.
606
+ // Done here (not in arc-host) so arc-host stays free of arc-otel runtime
607
+ // imports — duplicate @opentelemetry/api copies silently drop spans.
608
+ let dbAdapterFactory = baseDbFactory;
609
+ if (telemetry) {
610
+ // Pull wrapDbAdapter from `/server` (not the root export) so Bun
611
+ // doesn't double-bundle arc-otel for the CLI bundle. Both /server
612
+ // and / share telemetry.ts but split bundling otherwise.
613
+ const { wrapDbAdapter } = await import("@arcote.tech/arc-otel/server");
614
+ const dbSystem: "postgresql" | "sqlite" = process.env.DATABASE_URL
615
+ ? "postgresql"
616
+ : "sqlite";
617
+ dbAdapterFactory = async (ctx: any) => {
618
+ const a = await baseDbFactory(ctx);
619
+ return wrapDbAdapter(a, telemetry, dbSystem);
620
+ };
621
+ }
604
622
 
605
623
  const arcServer = await createArcServer({
606
624
  context,