@jeffreyjyz/mpc 0.1.0 → 0.1.2

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.
Files changed (56) hide show
  1. package/package.json +6 -2
  2. package/src/cli/engine/ability.ts +1 -1
  3. package/src/cli/engine/cost.ts +2 -2
  4. package/src/cli/engine/index.ts +2 -2
  5. package/src/cli/engine/project.ts +3 -3
  6. package/src/cli/engine/rows.ts +2 -2
  7. package/src/cli/engine/score.ts +2 -2
  8. package/src/cli/flow/check.ts +4 -4
  9. package/src/cli/flow/collect.ts +9 -9
  10. package/src/cli/flow/columns.ts +2 -2
  11. package/src/cli/flow/sort.ts +2 -2
  12. package/src/cli/options.ts +2 -2
  13. package/src/cli/parse/cac.ts +1 -1
  14. package/src/cli/parse/fields.ts +1 -1
  15. package/src/cli/parse/map.ts +3 -3
  16. package/src/cli/parse/validate.ts +1 -1
  17. package/src/cli/run.ts +4 -4
  18. package/src/constants/cli.ts +3 -3
  19. package/src/constants/scoring.ts +1 -1
  20. package/src/constants/view.ts +3 -3
  21. package/src/data/bench/cc.ts +2 -2
  22. package/src/data/bench/resolve.ts +1 -1
  23. package/src/data/bench/store.ts +4 -4
  24. package/src/data/scrape/catalog/catalog.ts +3 -3
  25. package/src/data/scrape/catalog/deal.ts +3 -3
  26. package/src/data/scrape/catalog/numeric.ts +2 -2
  27. package/src/data/scrape/roleRows.ts +1 -1
  28. package/src/data/scrape/tables.ts +1 -1
  29. package/src/data/shape.ts +2 -2
  30. package/src/data/sources/aa/api.ts +1 -1
  31. package/src/data/sources/aa/parse.ts +1 -1
  32. package/src/data/sources/aa/web.ts +3 -3
  33. package/src/data/sources/cc/catalog.ts +3 -3
  34. package/src/data/sources/cc/cmduse.ts +1 -1
  35. package/src/data/sources/cc/plans.ts +2 -2
  36. package/src/data/sources/opencode.ts +7 -3
  37. package/src/data/usage/index.ts +1 -1
  38. package/src/data/usage/log.ts +1 -1
  39. package/src/data/usage/logs.ts +1 -1
  40. package/src/data/usage/opencodeDb.ts +1 -1
  41. package/src/data/usage/parse.ts +2 -2
  42. package/src/keys.ts +1 -1
  43. package/src/view/columns/cc.ts +2 -2
  44. package/src/view/columns/meta.ts +3 -3
  45. package/src/view/columns/oc.ts +2 -2
  46. package/src/view/footer.ts +2 -2
  47. package/src/view/layout/fit.ts +3 -3
  48. package/src/view/layout/segments.ts +4 -4
  49. package/src/view/layout/table.ts +4 -4
  50. package/src/view/layout/usage.ts +4 -4
  51. package/src/view/render.ts +2 -2
  52. package/src/view/schema.ts +1 -1
  53. package/src/view/text/export.ts +3 -3
  54. package/src/view/text/format.ts +3 -3
  55. package/src/view/text/index.ts +1 -1
  56. package/src/view/text/styles.ts +3 -3
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@jeffreyjyz/mpc",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Compare model pricing across opencode Go and Command Code plans",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "mpc": "src/index.ts"
8
+ "mpc": "src/index.ts",
9
+ "mpcdev": "src/index.ts"
10
+ },
11
+ "imports": {
12
+ "#~/*": "./src/*"
9
13
  },
10
14
  "files": [
11
15
  "src",
@@ -1,4 +1,4 @@
1
- import { SPEED_SUFFIXES, SPEED_TPS_FACTOR } from "~/constants/scoring.ts";
1
+ import { SPEED_SUFFIXES, SPEED_TPS_FACTOR } from "#~/constants/scoring.ts";
2
2
 
3
3
  /**
4
4
  * The base key a speed variant shares weights with, or undefined. FlashX is the
@@ -1,5 +1,5 @@
1
- import { PER_MILLION } from "~/constants/scoring.ts";
2
- import type { ModelPricing, PlanInfo, Workload } from "~/types.ts";
1
+ import { PER_MILLION } from "#~/constants/scoring.ts";
2
+ import type { ModelPricing, PlanInfo, Workload } from "#~/types.ts";
3
3
 
4
4
  /**
5
5
  * USD of list-rate spend for a single request under the fixed workload.
@@ -1,11 +1,11 @@
1
- import { DEFAULT_SCORE } from "~/constants/scoring.ts";
1
+ import { DEFAULT_SCORE } from "#~/constants/scoring.ts";
2
2
  import type {
3
3
  CatalogEntry,
4
4
  EntryMetrics,
5
5
  PlanInfo,
6
6
  ProviderId,
7
7
  Workload,
8
- } from "~/types.ts";
8
+ } from "#~/types.ts";
9
9
  import { lookupAbility, lookupTps } from "./ability.ts";
10
10
  import { costPerRequest, windowRatios } from "./cost.ts";
11
11
  import { assignIndex, assignValueIndex, type ScoreConfig } from "./score.ts";
@@ -1,6 +1,6 @@
1
- import { PER_MILLION } from "~/constants/scoring.ts";
2
- import type { UsageEntry } from "~/data/usage/index.ts";
3
- import type { CatalogEntry, PlanInfo, ProviderId } from "~/types.ts";
1
+ import { PER_MILLION } from "#~/constants/scoring.ts";
2
+ import type { UsageEntry } from "#~/data/usage/index.ts";
3
+ import type { CatalogEntry, PlanInfo, ProviderId } from "#~/types.ts";
4
4
 
5
5
  export interface SideProjection {
6
6
  /** Cost of one real request at list rates. */
@@ -1,4 +1,4 @@
1
- import { DEFAULT_SCORE } from "~/constants/scoring.ts";
1
+ import { DEFAULT_SCORE } from "#~/constants/scoring.ts";
2
2
  import type {
3
3
  CatalogEntry,
4
4
  CompareRow,
@@ -6,7 +6,7 @@ import type {
6
6
  PlanInfo,
7
7
  ProviderId,
8
8
  Workload,
9
- } from "~/types.ts";
9
+ } from "#~/types.ts";
10
10
  import { buildMetrics } from "./index.ts";
11
11
  import type { ScoreConfig } from "./score.ts";
12
12
 
@@ -1,5 +1,5 @@
1
- import type { ScaleMode } from "~/cli/options.ts";
2
- import type { EntryMetrics } from "~/types.ts";
1
+ import type { ScaleMode } from "#~/cli/options.ts";
2
+ import type { EntryMetrics } from "#~/types.ts";
3
3
  import { logMinmax, minmax } from "./cost.ts";
4
4
 
5
5
  /** Everything the scorer can be told to do differently. */
@@ -1,7 +1,7 @@
1
- import type { Options } from "~/cli/options.ts";
2
- import { loadOcGoModelIds } from "~/data/sources/opencode.ts";
3
- import { normalizeKey } from "~/keys.ts";
4
- import type { CatalogEntry, CompareRow } from "~/types.ts";
1
+ import type { Options } from "#~/cli/options.ts";
2
+ import { loadOcGoModelIds } from "#~/data/sources/opencode.ts";
3
+ import { normalizeKey } from "#~/keys.ts";
4
+ import type { CatalogEntry, CompareRow } from "#~/types.ts";
5
5
 
6
6
  export interface AbilityInfo {
7
7
  label: string;
@@ -1,12 +1,12 @@
1
- import { buildRows } from "~/cli/engine/index.ts";
2
- import type { ScoreConfig } from "~/cli/engine/score.ts";
3
- import type { Options } from "~/cli/options.ts";
4
- import { loadAbility } from "~/data/bench/index.ts";
5
- import { loadShapes } from "~/data/shape.ts";
6
- import { loadCcCatalog } from "~/data/sources/cc/catalog.ts";
7
- import { loadCcPlan } from "~/data/sources/cc/plans.ts";
8
- import { loadOcGoCatalog, ocGoPlan } from "~/data/sources/opencode.ts";
9
- import type { ProviderId, Workload } from "~/types.ts";
1
+ import { buildRows } from "#~/cli/engine/index.ts";
2
+ import type { ScoreConfig } from "#~/cli/engine/score.ts";
3
+ import type { Options } from "#~/cli/options.ts";
4
+ import { loadAbility } from "#~/data/bench/index.ts";
5
+ import { loadShapes } from "#~/data/shape.ts";
6
+ import { loadCcCatalog } from "#~/data/sources/cc/catalog.ts";
7
+ import { loadCcPlan } from "#~/data/sources/cc/plans.ts";
8
+ import { loadOcGoCatalog, ocGoPlan } from "#~/data/sources/opencode.ts";
9
+ import type { ProviderId, Workload } from "#~/types.ts";
10
10
 
11
11
  function scoreConfig(options: Options): ScoreConfig {
12
12
  return {
@@ -1,5 +1,5 @@
1
- import type { Options } from "~/cli/options.ts";
2
- import { SETS, TIERS, type Tier } from "~/constants/cli.ts";
1
+ import type { Options } from "#~/cli/options.ts";
2
+ import { SETS, TIERS, type Tier } from "#~/constants/cli.ts";
3
3
 
4
4
  /**
5
5
  * The tier the flags asked for. The default is the full set — `--fit` used to
@@ -1,5 +1,5 @@
1
- import type { Metric, Options } from "~/cli/options.ts";
2
- import type { CompareRow } from "~/types.ts";
1
+ import type { Metric, Options } from "#~/cli/options.ts";
2
+ import type { CompareRow } from "#~/types.ts";
3
3
 
4
4
  export function matches(row: CompareRow, pattern: Options["model"]): boolean {
5
5
  if (!pattern) return true;
@@ -1,5 +1,5 @@
1
- import { FORMATS, METRICS } from "~/constants/cli.ts";
2
- import type { Workload } from "~/types.ts";
1
+ import { FORMATS, METRICS } from "#~/constants/cli.ts";
2
+ import type { Workload } from "#~/types.ts";
3
3
 
4
4
  export type Metric = "val" | "cost" | "perreq" | "req" | "name";
5
5
  export type ColorMode = "auto" | "always" | "never";
@@ -1,5 +1,5 @@
1
1
  import { cac } from "cac";
2
- import type { Options } from "~/cli/options.ts";
2
+ import type { Options } from "#~/cli/options.ts";
3
3
  import pkg from "../../../package.json" with { type: "json" };
4
4
  import { type Bag, toOptions } from "./map.ts";
5
5
 
@@ -1,4 +1,4 @@
1
- import type { ColorMode } from "~/cli/options.ts";
1
+ import type { ColorMode } from "#~/cli/options.ts";
2
2
  import type { Bag } from "./validate.ts";
3
3
 
4
4
  /** Comma-separated or repeated flag, read as numbers. */
@@ -6,9 +6,9 @@ import {
6
6
  parseMetric,
7
7
  parseOnly,
8
8
  type ScaleMode,
9
- } from "~/cli/options.ts";
10
- import { ARG_DEFAULTS, BENCH_DEFAULT } from "~/constants/cli.ts";
11
- import { SHAPE_MEASURED } from "~/constants/shape.ts";
9
+ } from "#~/cli/options.ts";
10
+ import { ARG_DEFAULTS, BENCH_DEFAULT } from "#~/constants/cli.ts";
11
+ import { SHAPE_MEASURED } from "#~/constants/shape.ts";
12
12
  import {
13
13
  colorMode,
14
14
  numbers,
@@ -1,4 +1,4 @@
1
- import { INTERNAL, KNOWN, VALUED } from "~/constants/cli.ts";
1
+ import { INTERNAL, KNOWN, VALUED } from "#~/constants/cli.ts";
2
2
 
3
3
  export type Bag = Record<string, unknown>;
4
4
 
package/src/cli/run.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bun
2
- import { COLUMN_HELP, COLUMN_IDS } from "~/constants/view.ts";
3
- import { loadUsage } from "~/data/usage/index.ts";
4
- import { renderUsage } from "~/view/layout/usage.ts";
2
+ import { COLUMN_HELP, COLUMN_IDS } from "#~/constants/view.ts";
3
+ import { loadUsage } from "#~/data/usage/index.ts";
4
+ import { renderUsage } from "#~/view/layout/usage.ts";
5
5
  import {
6
6
  fitColumns,
7
7
  renderCsv,
@@ -11,7 +11,7 @@ import {
11
11
  setColorMode,
12
12
  setThresholds,
13
13
  tally,
14
- } from "~/view/render.ts";
14
+ } from "#~/view/render.ts";
15
15
  import { describeConfig, resolveBag } from "./config.ts";
16
16
  import { project } from "./engine/project.ts";
17
17
  import { runCheck } from "./flow/check.ts";
@@ -1,10 +1,10 @@
1
- import type { Format, Metric } from "~/cli/options.ts";
2
- import { SHAPE_AUTO } from "~/constants/shape.ts";
1
+ import type { Format, Metric } from "#~/cli/options.ts";
2
+ import { SHAPE_AUTO } from "#~/constants/shape.ts";
3
3
  import {
4
4
  DETAIL_COLUMNS,
5
5
  MEDIUM_COLUMNS,
6
6
  MINIMAL_COLUMNS,
7
- } from "~/constants/view.ts";
7
+ } from "#~/constants/view.ts";
8
8
 
9
9
  /** Workload defaults asserted by `--in` / `--cache` / `--out` when unset. */
10
10
  export const OPTION_DEFAULTS = {
@@ -1,4 +1,4 @@
1
- import type { ScoreConfig } from "~/cli/engine/score.ts";
1
+ import type { ScoreConfig } from "#~/cli/engine/score.ts";
2
2
 
3
3
  /** Tokens per million, the denominator of every per-M-token rate. */
4
4
  export const PER_MILLION = 1_000_000;
@@ -1,6 +1,6 @@
1
- import type { ProviderId } from "~/types.ts";
2
- import { CC_COLUMNS } from "~/view/columns/cc.ts";
3
- import { OC_COLUMNS } from "~/view/columns/oc.ts";
1
+ import type { ProviderId } from "#~/types.ts";
2
+ import { CC_COLUMNS } from "#~/view/columns/cc.ts";
3
+ import { OC_COLUMNS } from "#~/view/columns/oc.ts";
4
4
 
5
5
  /**
6
6
  * SGR codes with **one meaning each**. `green` = favourable (cheaper side, free,
@@ -1,9 +1,9 @@
1
- import { PAGES, TPS_HEADER } from "~/constants/sources.ts";
1
+ import { PAGES, TPS_HEADER } from "#~/constants/sources.ts";
2
2
  import {
3
3
  extractNumericColumn,
4
4
  fetchText,
5
5
  parseTables,
6
- } from "~/data/scrape/index.ts";
6
+ } from "#~/data/scrape/index.ts";
7
7
  import { type BenchData, emptyData } from "./types.ts";
8
8
 
9
9
  export async function loadCc(): Promise<BenchData> {
@@ -1,4 +1,4 @@
1
- import { loadAaApi } from "~/data/sources/aa/api.ts";
1
+ import { loadAaApi } from "#~/data/sources/aa/api.ts";
2
2
  import { loadCc } from "./cc.ts";
3
3
  import { loadAaWebCached, loadFile, loadUrl } from "./store.ts";
4
4
  import {
@@ -1,6 +1,6 @@
1
- import { CACHE_TTL_MS } from "~/constants/sources.ts";
2
- import { fetchText } from "~/data/scrape/index.ts";
3
- import { normalizeKey } from "~/keys.ts";
1
+ import { CACHE_TTL_MS } from "#~/constants/sources.ts";
2
+ import { fetchText } from "#~/data/scrape/index.ts";
3
+ import { normalizeKey } from "#~/keys.ts";
4
4
 
5
5
  function parseJsonScores(text: string): Map<string, number> {
6
6
  const body = JSON.parse(text) as unknown;
@@ -39,7 +39,7 @@ export async function loadUrl(url: string): Promise<Map<string, number>> {
39
39
  import { mkdir } from "node:fs/promises";
40
40
  import { homedir } from "node:os";
41
41
  import { join } from "node:path";
42
- import { loadAaWeb } from "~/data/sources/aa/web.ts";
42
+ import { loadAaWeb } from "#~/data/sources/aa/web.ts";
43
43
 
44
44
  function cachePath(): string {
45
45
  const base = process.env.XDG_CACHE_HOME ?? join(homedir(), ".cache");
@@ -4,9 +4,9 @@ import {
4
4
  nameCell,
5
5
  parseMoney,
6
6
  type Table,
7
- } from "~/data/scrape/tables.ts";
8
- import { displayName, normalizeKey } from "~/keys.ts";
9
- import type { CatalogEntry, ModelPricing, ProviderId } from "~/types.ts";
7
+ } from "#~/data/scrape/tables.ts";
8
+ import { displayName, normalizeKey } from "#~/keys.ts";
9
+ import type { CatalogEntry, ModelPricing, ProviderId } from "#~/types.ts";
10
10
  import { dealIn } from "./deal.ts";
11
11
  import { variantScore } from "./variant.ts";
12
12
 
@@ -1,6 +1,6 @@
1
- import { BADGE, BOUNDARY, ENDS } from "~/constants/data.ts";
2
- import { cellText } from "~/data/scrape/tables.ts";
3
- import type { Deal } from "~/types.ts";
1
+ import { BADGE, BOUNDARY, ENDS } from "#~/constants/data.ts";
2
+ import { cellText } from "#~/data/scrape/tables.ts";
3
+ import type { Deal } from "#~/types.ts";
4
4
 
5
5
  /**
6
6
  * Read the promotion from a raw model name cell. `nameCell` deliberately keeps
@@ -3,8 +3,8 @@ import {
3
3
  headerIndex,
4
4
  nameCell,
5
5
  type Table,
6
- } from "~/data/scrape/tables.ts";
7
- import { normalizeKey } from "~/keys.ts";
6
+ } from "#~/data/scrape/tables.ts";
7
+ import { normalizeKey } from "#~/keys.ts";
8
8
 
9
9
  /**
10
10
  * Pull one numeric column out of any tables that carry it, keyed by model.
@@ -1,4 +1,4 @@
1
- import { BOUNDARY } from "~/constants/data.ts";
1
+ import { BOUNDARY } from "#~/constants/data.ts";
2
2
  import type { Table } from "./tables.ts";
3
3
 
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { BOUNDARY } from "~/constants/data.ts";
1
+ import { BOUNDARY } from "#~/constants/data.ts";
2
2
 
3
3
  export type Table = string[][];
4
4
 
package/src/data/shape.ts CHANGED
@@ -4,8 +4,8 @@ import {
4
4
  SHAPE_MEASURED,
5
5
  SHAPE_MIN_REQS,
6
6
  SHAPE_OFF,
7
- } from "~/constants/shape.ts";
8
- import type { Workload } from "~/types.ts";
7
+ } from "#~/constants/shape.ts";
8
+ import type { Workload } from "#~/types.ts";
9
9
  import { runBinary } from "./cmduse.ts";
10
10
 
11
11
  interface Profile {
@@ -1,4 +1,4 @@
1
- import { API_URL } from "~/constants/sources.ts";
1
+ import { API_URL } from "#~/constants/sources.ts";
2
2
  import { parseAaApi } from "./parse.ts";
3
3
 
4
4
  /** Full catalog via the Artificial Analysis API. Needs a key. Paginated. */
@@ -1,4 +1,4 @@
1
- import { normalizeKey } from "~/keys.ts";
1
+ import { normalizeKey } from "#~/keys.ts";
2
2
 
3
3
  /** Pure parser over one AA API page, for tests and the loader. */
4
4
  export function parseAaApi(body: unknown): {
@@ -1,6 +1,6 @@
1
- import { AA_MODELS_URL } from "~/constants/sources.ts";
2
- import { fetchText } from "~/data/scrape/index.ts";
3
- import { normalizeKey } from "~/keys.ts";
1
+ import { AA_MODELS_URL } from "#~/constants/sources.ts";
2
+ import { fetchText } from "#~/data/scrape/index.ts";
3
+ import { normalizeKey } from "#~/keys.ts";
4
4
 
5
5
  /** A model label and its Artificial Analysis Intelligence Index. */
6
6
  interface Scored {
@@ -1,11 +1,11 @@
1
- import { CC_PLANS } from "~/constants/sources.ts";
1
+ import { CC_PLANS } from "#~/constants/sources.ts";
2
2
  import {
3
3
  extractCatalog,
4
4
  fetchText,
5
5
  parseRoleRows,
6
6
  parseTables,
7
- } from "~/data/scrape/index.ts";
8
- import type { CatalogEntry } from "~/types.ts";
7
+ } from "#~/data/scrape/index.ts";
8
+ import type { CatalogEntry } from "#~/types.ts";
9
9
 
10
10
  /** Per-model token rates + monthly credit allowance for a CommandCode plan. */
11
11
  export async function loadCcCatalog(planId: string): Promise<CatalogEntry[]> {
@@ -1,4 +1,4 @@
1
- import { runCmduse } from "~/data/cmduse.ts";
1
+ import { runCmduse } from "#~/data/cmduse.ts";
2
2
 
3
3
  interface CmdusePlan {
4
4
  name: string;
@@ -1,5 +1,5 @@
1
- import { CC_PLANS } from "~/constants/sources.ts";
2
- import type { PlanInfo } from "~/types.ts";
1
+ import { CC_PLANS } from "#~/constants/sources.ts";
2
+ import type { PlanInfo } from "#~/types.ts";
3
3
  import { cmdusePlans, money } from "./cmduse.ts";
4
4
 
5
5
  /** Plan price + windows for a CommandCode plan, from the official JSON. */
@@ -2,9 +2,13 @@ import {
2
2
  DOC_URL,
3
3
  OC_MODELS_URL,
4
4
  PRICE_PER_MONTH,
5
- } from "~/constants/sources.ts";
6
- import { extractCatalog, fetchText, parseTables } from "~/data/scrape/index.ts";
7
- import type { CatalogEntry, PlanInfo } from "~/types.ts";
5
+ } from "#~/constants/sources.ts";
6
+ import {
7
+ extractCatalog,
8
+ fetchText,
9
+ parseTables,
10
+ } from "#~/data/scrape/index.ts";
11
+ import type { CatalogEntry, PlanInfo } from "#~/types.ts";
8
12
 
9
13
  /** Per-model token rates + monthly usage limit for OpenCode Go. */
10
14
  export async function loadOcGoCatalog(peak = false): Promise<CatalogEntry[]> {
@@ -1,4 +1,4 @@
1
- import { runCmduse } from "~/data/cmduse.ts";
1
+ import { runCmduse } from "#~/data/cmduse.ts";
2
2
  import { defaultUsageLog, mergeUsage, readUsageLog } from "./log.ts";
3
3
  import { scanLogs } from "./logs.ts";
4
4
  import { defaultOpencodeDb, readOpencodeDb } from "./opencodeDb.ts";
@@ -1,7 +1,7 @@
1
1
  import { readFileSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { join } from "node:path";
4
- import { normalizeKey } from "~/keys.ts";
4
+ import { normalizeKey } from "#~/keys.ts";
5
5
  import type { UsageEntry } from "./parse.ts";
6
6
 
7
7
  interface LogLine {
@@ -1,7 +1,7 @@
1
1
  import { readdirSync, readFileSync, statSync } from "node:fs";
2
2
  import { homedir } from "node:os";
3
3
  import { join } from "node:path";
4
- import { normalizeKey } from "~/keys.ts";
4
+ import { normalizeKey } from "#~/keys.ts";
5
5
  import type { UsageEntry } from "./parse.ts";
6
6
 
7
7
  interface Totals {
@@ -1,7 +1,7 @@
1
1
  import { Database } from "bun:sqlite";
2
2
  import { homedir } from "node:os";
3
3
  import { join } from "node:path";
4
- import { normalizeKey } from "~/keys.ts";
4
+ import { normalizeKey } from "#~/keys.ts";
5
5
  import { hasV2, readV2Turns, type Turn } from "./opencodeV2.ts";
6
6
  import type { UsageEntry } from "./parse.ts";
7
7
 
@@ -1,5 +1,5 @@
1
- import { runCmduse } from "~/data/cmduse.ts";
2
- import { normalizeKey } from "~/keys.ts";
1
+ import { runCmduse } from "#~/data/cmduse.ts";
2
+ import { normalizeKey } from "#~/keys.ts";
3
3
 
4
4
  export interface UsageEntry {
5
5
  key: string;
package/src/keys.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { ALIASES, BOUNDARY } from "~/constants/data.ts";
1
+ import { ALIASES, BOUNDARY } from "#~/constants/data.ts";
2
2
 
3
3
  /**
4
4
  * Collapse a model name from either catalog onto a shared key.
@@ -1,5 +1,5 @@
1
- import type { Column } from "~/view/schema.ts";
2
- import * as f from "~/view/text/index.ts";
1
+ import type { Column } from "#~/view/schema.ts";
2
+ import * as f from "#~/view/text/index.ts";
3
3
 
4
4
  export const CC_COLUMNS: Record<string, Column> = {
5
5
  "cc-rates": {
@@ -1,6 +1,6 @@
1
- import { SGR } from "~/constants/view.ts";
2
- import type { Column } from "~/view/schema.ts";
3
- import * as f from "~/view/text/index.ts";
1
+ import { SGR } from "#~/constants/view.ts";
2
+ import type { Column } from "#~/view/schema.ts";
3
+ import * as f from "#~/view/text/index.ts";
4
4
 
5
5
  export const META_COLUMNS: Record<string, Column> = {
6
6
  model: { header: "MODEL", value: (r) => r.name, style: () => SGR.bold },
@@ -1,5 +1,5 @@
1
- import type { Column } from "~/view/schema.ts";
2
- import * as f from "~/view/text/index.ts";
1
+ import type { Column } from "#~/view/schema.ts";
2
+ import * as f from "#~/view/text/index.ts";
3
3
 
4
4
  export const OC_COLUMNS: Record<string, Column> = {
5
5
  "oc-rates": {
@@ -1,5 +1,5 @@
1
- import { LEGEND, PROVIDER_COLOR, SGR } from "~/constants/view.ts";
2
- import type { CompareRow, PlanInfo, Workload } from "~/types.ts";
1
+ import { LEGEND, PROVIDER_COLOR, SGR } from "#~/constants/view.ts";
2
+ import type { CompareRow, PlanInfo, Workload } from "#~/types.ts";
3
3
  import { tally } from "./layout/segments.ts";
4
4
  import type { ReportMeta } from "./schema.ts";
5
5
  import {
@@ -1,6 +1,6 @@
1
- import { BAR } from "~/constants/view.ts";
2
- import type { Column, FitResult, Row } from "~/view/schema.ts";
3
- import { columns } from "~/view/schema.ts";
1
+ import { BAR } from "#~/constants/view.ts";
2
+ import type { Column, FitResult, Row } from "#~/view/schema.ts";
3
+ import { columns } from "#~/view/schema.ts";
4
4
  import { buildSegments } from "./segments.ts";
5
5
 
6
6
  function measure(
@@ -1,6 +1,6 @@
1
- import { GAP } from "~/constants/view.ts";
2
- import type { Column, GroupKey, Segment } from "~/view/schema.ts";
3
- import { paint } from "~/view/text/index.ts";
1
+ import { GAP } from "#~/constants/view.ts";
2
+ import type { Column, GroupKey, Segment } from "#~/view/schema.ts";
3
+ import { paint } from "#~/view/text/index.ts";
4
4
 
5
5
  function groupOf(id: string): GroupKey {
6
6
  if (id === "model") return "model";
@@ -70,7 +70,7 @@ export function renderSegment(
70
70
  .join(GAP);
71
71
  }
72
72
 
73
- import type { Row, Tally } from "~/view/schema.ts";
73
+ import type { Row, Tally } from "#~/view/schema.ts";
74
74
 
75
75
  export function tally(rows: Row[]): Tally {
76
76
  const result: Tally = {
@@ -1,7 +1,7 @@
1
- import { BAR, BAR_RULE, SGR } from "~/constants/view.ts";
2
- import type { Column, GroupKey, GroupLabel, Row } from "~/view/schema.ts";
3
- import { columns } from "~/view/schema.ts";
4
- import { paint } from "~/view/text/index.ts";
1
+ import { BAR, BAR_RULE, SGR } from "#~/constants/view.ts";
2
+ import type { Column, GroupKey, GroupLabel, Row } from "#~/view/schema.ts";
3
+ import { columns } from "#~/view/schema.ts";
4
+ import { paint } from "#~/view/text/index.ts";
5
5
  import { buildSegments, renderSegment } from "./segments.ts";
6
6
 
7
7
  function measure(
@@ -1,7 +1,7 @@
1
- import type { UsageProjection, UsageRow } from "~/cli/engine/project.ts";
2
- import { HEADERS, SGR } from "~/constants/view.ts";
3
- import type { PlanInfo, ProviderId } from "~/types.ts";
4
- import { fmtCount, fmtUsd, paint, planTitle } from "~/view/text/index.ts";
1
+ import type { UsageProjection, UsageRow } from "#~/cli/engine/project.ts";
2
+ import { HEADERS, SGR } from "#~/constants/view.ts";
3
+ import type { PlanInfo, ProviderId } from "#~/types.ts";
4
+ import { fmtCount, fmtUsd, paint, planTitle } from "#~/view/text/index.ts";
5
5
 
6
6
  export interface UsageMeta {
7
7
  label: string;
@@ -1,5 +1,5 @@
1
- import { PROVIDER_COLOR, SGR } from "~/constants/view.ts";
2
- import type { CompareRow } from "~/types.ts";
1
+ import { PROVIDER_COLOR, SGR } from "#~/constants/view.ts";
2
+ import type { CompareRow } from "#~/types.ts";
3
3
  import { footer } from "./footer.ts";
4
4
  import { tally } from "./layout/segments.ts";
5
5
  import { printTable } from "./layout/table.ts";
@@ -1,4 +1,4 @@
1
- import type { CompareRow, PlanInfo, ProviderId, Workload } from "~/types.ts";
1
+ import type { CompareRow, PlanInfo, ProviderId, Workload } from "#~/types.ts";
2
2
 
3
3
  export type Row = CompareRow;
4
4
 
@@ -1,6 +1,6 @@
1
- import { CSV_HEADER } from "~/constants/view.ts";
2
- import type { PlanInfo } from "~/types.ts";
3
- import type { Row, Tally } from "~/view/schema.ts";
1
+ import { CSV_HEADER } from "#~/constants/view.ts";
2
+ import type { PlanInfo } from "#~/types.ts";
3
+ import type { Row, Tally } from "#~/view/schema.ts";
4
4
  import { fmtAbility, fmtCount, fmtTps, planTitle } from "./format.ts";
5
5
 
6
6
  function csvCell(value: string | number): string {
@@ -1,5 +1,5 @@
1
- import type { EntryMetrics } from "~/types.ts";
2
- import type { Row } from "~/view/schema.ts";
1
+ import type { EntryMetrics } from "#~/types.ts";
2
+ import type { Row } from "#~/view/schema.ts";
3
3
 
4
4
  export function fmtCount(n: number): string {
5
5
  if (!Number.isFinite(n)) return "∞";
@@ -59,7 +59,7 @@ export function fmtTps(row: Row): string {
59
59
  return tps === null ? "—" : Math.round(tps).toString();
60
60
  }
61
61
 
62
- import type { ProviderId } from "~/types.ts";
62
+ import type { ProviderId } from "#~/types.ts";
63
63
 
64
64
  export function providerName(provider: ProviderId): string {
65
65
  return provider === "oc-go" ? "OpenCode" : "CommandCode";
@@ -1,4 +1,4 @@
1
- import type { ColorMode } from "~/cli/options.ts";
1
+ import type { ColorMode } from "#~/cli/options.ts";
2
2
 
3
3
  let color = true;
4
4
 
@@ -1,6 +1,6 @@
1
- import { PROVIDER_COLOR, PROVIDER_TINT, SGR } from "~/constants/view.ts";
2
- import type { EntryMetrics, ProviderId } from "~/types.ts";
3
- import type { Row } from "~/view/schema.ts";
1
+ import { PROVIDER_COLOR, PROVIDER_TINT, SGR } from "#~/constants/view.ts";
2
+ import type { EntryMetrics, ProviderId } from "#~/types.ts";
3
+ import type { Row } from "#~/view/schema.ts";
4
4
  import { fmtRate, shortProviderName } from "./format.ts";
5
5
 
6
6
  /** Which side is cheaper per request on this row. */