codeburn/packages/core/tsup.config.ts
iamtoruk 93b4f7707f refactor(core): copilot decode into core (phase 8, sqlite batch 3)
Bridged via a tagged envelope record across the four parse paths
(jsonl / chatsession / jetbrains / otel): readRecords shapes one envelope
per source kind and a single decodeCopilot dispatches on envelope.kind.

The sqlite driver, the three OTel queries, blob reads, git-root probing,
extractBashCommands / extractOtelBashCommands, and the sanctioned
shutdown-site calculateCost residual all stay host-side. The residual
keeps its exact argument order (model, input, 0, cacheWrite, cacheRead, 0),
emits costUSD + costIsEstimated: false with no costBasis key, and carries
its explanatory comment unchanged.

Validator fixes over the draft:
- collectJetBrainsRepoDirCandidates used a [\|"] character class instead
  of the original's (?:\\|") alternation, so a file:// path containing a
  pipe was truncated, its dir never resolved, and the JetBrains project
  fell back to the generic bucket. Restored the alternation.
- the otel arm dropped the subagentTypes key when undefined; the original
  always emits it. Restored so key presence matches byte for byte.
- otel chat-span attributes were looked up with a linear Array.find per
  chat span; replaced with a per-span-id map built in the same pass.

Verified by a differential harness running the pre-migration provider
against the migrated one over 27 scenarios (all eight goldens plus
edge cases), comparing calls, seenKeys, and key presence. The harness is
not committed; the scenarios it proved are now goldens G9-G17.
2026-07-26 21:17:48 -07:00

49 lines
1.5 KiB
TypeScript

import { defineConfig } from 'tsup'
export default defineConfig({
// One entry per exports-map subpath. `internal/*` is deliberately excluded so
// `zod-to-json-schema` never enters the runtime bundle.
entry: [
'src/index.ts',
'src/schema.ts',
'src/observations.ts',
'src/diagnostics.ts',
'src/fingerprint.ts',
'src/contracts.ts',
'src/detectors/index.ts',
'src/providers/claude/index.ts',
'src/providers/codebuff/index.ts',
'src/providers/codewhale/index.ts',
'src/providers/codex/index.ts',
'src/providers/grok/index.ts',
'src/providers/kimi/index.ts',
'src/providers/qwen/index.ts',
'src/providers/zerostack/index.ts',
'src/providers/droid/index.ts',
'src/providers/mux/index.ts',
'src/providers/openclaw/index.ts',
'src/providers/open-design/index.ts',
'src/providers/lingtai-tui/index.ts',
'src/providers/gemini/index.ts',
'src/providers/kimicode/index.ts',
'src/providers/pi/index.ts',
'src/providers/crush/index.ts',
'src/providers/zcode/index.ts',
'src/providers/zed/index.ts',
'src/providers/forge/index.ts',
'src/providers/goose/index.ts',
'src/providers/hermes/index.ts',
'src/providers/warp/index.ts',
'src/providers/cursor-agent/index.ts',
'src/providers/quickdesk/index.ts',
'src/providers/devin/index.ts',
'src/providers/copilot/index.ts',
],
format: ['esm'],
target: 'node20',
outDir: 'dist',
clean: true,
splitting: false,
sourcemap: true,
dts: true,
})