@jeffreyjyz/reqshape 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.
- package/package.json +6 -2
- package/src/cli/flags.ts +1 -1
- package/src/cli/options.ts +3 -3
- package/src/cli/run.ts +12 -12
- package/src/constants/asks.ts +1 -1
- package/src/market/project.ts +1 -1
- package/src/measure/asks.ts +2 -2
- package/src/measure/filter.ts +2 -2
- package/src/measure/profile.ts +1 -1
- package/src/measure/sides.ts +2 -2
- package/src/measure/stats.ts +1 -1
- package/src/view/format.ts +1 -1
- package/src/view/json.ts +3 -3
- package/src/view/render.ts +3 -3
- package/src/view/sections.ts +2 -2
- package/src/view/table.ts +3 -3
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jeffreyjyz/reqshape",
|
|
3
|
-
"version": "0.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
package/src/cli/options.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DEFAULT_KEYWORDS } from "
|
|
2
|
-
import type { CustomRates } from "
|
|
3
|
-
import { defaultStorePath } from "
|
|
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 "
|
|
2
|
-
import { type Projection, projectAll } from "
|
|
3
|
-
import { customEntry, type RateEntry } from "
|
|
4
|
-
import { loadAccount, loadMpc } from "
|
|
5
|
-
import { buildAsks } from "
|
|
6
|
-
import { filterAsks } from "
|
|
7
|
-
import { buildShape } from "
|
|
8
|
-
import { readStore } from "
|
|
9
|
-
import type { Profile } from "
|
|
10
|
-
import { setColorMode } from "
|
|
11
|
-
import { renderJson } from "
|
|
12
|
-
import { renderText } from "
|
|
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
|
|
package/src/constants/asks.ts
CHANGED
package/src/market/project.ts
CHANGED
package/src/measure/asks.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BOUNDARY } from "
|
|
2
|
-
import type { Ask, AskKind, Req } from "
|
|
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
|
|
package/src/measure/filter.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FILLER } from "
|
|
2
|
-
import type { Ask, DropCount } from "
|
|
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. */
|
package/src/measure/profile.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Ask, Bucket, Profile, Req, Shape, Stats } from "
|
|
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
|
|
package/src/measure/sides.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { CC_PREFIXES } from "
|
|
2
|
-
import type { Req, Side, SideShape } from "
|
|
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. */
|
package/src/measure/stats.ts
CHANGED
package/src/view/format.ts
CHANGED
package/src/view/json.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Projection } from "
|
|
2
|
-
import { providerName } from "
|
|
3
|
-
import type { DropCount, Shape } from "
|
|
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;
|
package/src/view/render.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Projection } from "
|
|
2
|
-
import type { AccountSummary } from "
|
|
3
|
-
import type { DropCount, Shape } from "
|
|
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,
|
package/src/view/sections.ts
CHANGED
package/src/view/table.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { CELL, MONEY, NAME, PLAN } from "
|
|
2
|
-
import type { Projection } from "
|
|
3
|
-
import { planLabel } from "
|
|
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 {
|