@jeffreyjyz/reqshape 0.1.1 → 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.
package/package.json CHANGED
@@ -1,11 +1,15 @@
1
1
  {
2
2
  "name": "@jeffreyjyz/reqshape",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Measure the shape of your requests from opencode's own history, then price it against any model",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "reqshape": "src/index.ts"
8
+ "reqshape": "src/index.ts",
9
+ "reqshapedev": "src/index.ts"
10
+ },
11
+ "imports": {
12
+ "#~/*": "./src/*"
9
13
  },
10
14
  "files": [
11
15
  "src",
package/src/cli/flags.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { CustomRates } from "~/market/rates.ts";
1
+ import type { CustomRates } from "#~/market/rates.ts";
2
2
 
3
3
  /**
4
4
  * cac prints --help and --version itself and only sets `run = false`, which is
@@ -1,6 +1,6 @@
1
- import { DEFAULT_KEYWORDS } from "~/constants/keywords.ts";
2
- import type { CustomRates } from "~/market/rates.ts";
3
- import { defaultStorePath } from "~/measure/store.ts";
1
+ import { DEFAULT_KEYWORDS } from "#~/constants/keywords.ts";
2
+ import type { CustomRates } from "#~/market/rates.ts";
3
+ import { defaultStorePath } from "#~/measure/store.ts";
4
4
 
5
5
  export interface Options {
6
6
  /** `user` keeps only prompts you typed; `all` includes subagent sessions. */
package/src/cli/run.ts CHANGED
@@ -1,15 +1,15 @@
1
- import { entriesOf } from "~/market/entries.ts";
2
- import { type Projection, projectAll } from "~/market/project.ts";
3
- import { customEntry, type RateEntry } from "~/market/rates.ts";
4
- import { loadAccount, loadMpc } from "~/market/sources.ts";
5
- import { buildAsks } from "~/measure/asks.ts";
6
- import { filterAsks } from "~/measure/filter.ts";
7
- import { buildShape } from "~/measure/profile.ts";
8
- import { readStore } from "~/measure/store.ts";
9
- import type { Profile } from "~/types.ts";
10
- import { setColorMode } from "~/view/format.ts";
11
- import { renderJson } from "~/view/json.ts";
12
- import { renderText } from "~/view/render.ts";
1
+ import { entriesOf } from "#~/market/entries.ts";
2
+ import { type Projection, projectAll } from "#~/market/project.ts";
3
+ import { customEntry, type RateEntry } from "#~/market/rates.ts";
4
+ import { loadAccount, loadMpc } from "#~/market/sources.ts";
5
+ import { buildAsks } from "#~/measure/asks.ts";
6
+ import { filterAsks } from "#~/measure/filter.ts";
7
+ import { buildShape } from "#~/measure/profile.ts";
8
+ import { readStore } from "#~/measure/store.ts";
9
+ import type { Profile } from "#~/types.ts";
10
+ import { setColorMode } from "#~/view/format.ts";
11
+ import { renderJson } from "#~/view/json.ts";
12
+ import { renderText } from "#~/view/render.ts";
13
13
  import type { Options } from "./options.ts";
14
14
  import { parseArgs } from "./parse.ts";
15
15
 
@@ -1,4 +1,4 @@
1
- import type { AskKind } from "~/types.ts";
1
+ import type { AskKind } from "#~/types.ts";
2
2
 
3
3
  /**
4
4
  * Row kinds that *open* a new ask. Only a prompt the user typed does.
@@ -1,4 +1,4 @@
1
- import type { Profile } from "~/types.ts";
1
+ import type { Profile } from "#~/types.ts";
2
2
  import type { RateEntry } from "./rates.ts";
3
3
 
4
4
  /** One model's answer to "how many requests does my allowance buy me?". */
@@ -1,5 +1,5 @@
1
- import { BOUNDARY } from "~/constants/asks.ts";
2
- import type { Ask, AskKind, Req } from "~/types.ts";
1
+ import { BOUNDARY } from "#~/constants/asks.ts";
2
+ import type { Ask, AskKind, Req } from "#~/types.ts";
3
3
  import type { RawMessage } from "./rows.ts";
4
4
  import type { SessionRow } from "./store.ts";
5
5
 
@@ -1,5 +1,5 @@
1
- import { FILLER } from "~/constants/keywords.ts";
2
- import type { Ask, DropCount } from "~/types.ts";
1
+ import { FILLER } from "#~/constants/keywords.ts";
2
+ import type { Ask, DropCount } from "#~/types.ts";
3
3
 
4
4
  export interface FilterOptions {
5
5
  /** `user` keeps only the prompts you typed, dropping subagent sessions. */
@@ -1,4 +1,4 @@
1
- import type { Ask, Bucket, Profile, Req, Shape, Stats } from "~/types.ts";
1
+ import type { Ask, Bucket, Profile, Req, Shape, Stats } from "#~/types.ts";
2
2
  import { sideProfiles } from "./sides.ts";
3
3
  import { emptyProfile, FIELDS, mean, reqProfile, stats } from "./stats.ts";
4
4
 
@@ -1,5 +1,5 @@
1
- import { CC_PREFIXES } from "~/constants/providers.ts";
2
- import type { Req, Side, SideShape } from "~/types.ts";
1
+ import { CC_PREFIXES } from "#~/constants/providers.ts";
2
+ import type { Req, Side, SideShape } from "#~/types.ts";
3
3
  import { reqProfile } from "./stats.ts";
4
4
 
5
5
  /** Which plan a provider id's traffic belongs to; null when it is neither. */
@@ -1,4 +1,4 @@
1
- import type { Profile, Req, Stats } from "~/types.ts";
1
+ import type { Profile, Req, Stats } from "#~/types.ts";
2
2
 
3
3
  export function mean(values: number[]): number {
4
4
  if (values.length === 0) return 0;
@@ -1,4 +1,4 @@
1
- import { ANSI } from "~/constants/ansi.ts";
1
+ import { ANSI } from "#~/constants/ansi.ts";
2
2
 
3
3
  let colored = Boolean(process.stdout.isTTY) && !process.env.NO_COLOR;
4
4
 
package/src/view/json.ts CHANGED
@@ -1,6 +1,6 @@
1
- import type { Projection } from "~/market/project.ts";
2
- import { providerName } from "~/market/rates.ts";
3
- import type { DropCount, Shape } from "~/types.ts";
1
+ import type { Projection } from "#~/market/project.ts";
2
+ import { providerName } from "#~/market/rates.ts";
3
+ import type { DropCount, Shape } from "#~/types.ts";
4
4
 
5
5
  export interface JsonInput {
6
6
  shape: Shape;
@@ -1,6 +1,6 @@
1
- import type { Projection } from "~/market/project.ts";
2
- import type { AccountSummary } from "~/market/sources.ts";
3
- import type { DropCount, Shape } from "~/types.ts";
1
+ import type { Projection } from "#~/market/project.ts";
2
+ import type { AccountSummary } from "#~/market/sources.ts";
3
+ import type { DropCount, Shape } from "#~/types.ts";
4
4
  import { bold, dim, fmtCount, fmtInt } from "./format.ts";
5
5
  import {
6
6
  block,
@@ -1,5 +1,5 @@
1
- import { LABEL } from "~/constants/layout.ts";
2
- import type { DropCount, Shape, Side } from "~/types.ts";
1
+ import { LABEL } from "#~/constants/layout.ts";
2
+ import type { DropCount, Shape, Side } from "#~/types.ts";
3
3
  import {
4
4
  bold,
5
5
  dim,
package/src/view/table.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { CELL, MONEY, NAME, PLAN } from "~/constants/layout.ts";
2
- import type { Projection } from "~/market/project.ts";
3
- import { planLabel } from "~/market/rates.ts";
1
+ import { CELL, MONEY, NAME, PLAN } from "#~/constants/layout.ts";
2
+ import type { Projection } from "#~/market/project.ts";
3
+ import { planLabel } from "#~/market/rates.ts";
4
4
  import { dim, fmtCount, fmtUsd, pad } from "./format.ts";
5
5
 
6
6
  export function tableHeader(): string {