vibedate 0.1.0
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/LICENSE +21 -0
- package/README.md +117 -0
- package/dist/chunk-64ME4THO.js +126 -0
- package/dist/chunk-AU7FN2LY.js +133 -0
- package/dist/cli.d.ts +15 -0
- package/dist/cli.js +1075 -0
- package/dist/index.d.ts +98 -0
- package/dist/index.js +28 -0
- package/dist/mcp.d.ts +7 -0
- package/dist/mcp.js +7 -0
- package/package.json +63 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Harness, UsageSnapshot } from '@pooriaarab/vibe-core';
|
|
2
|
+
export { Harness, UsageSnapshot, createConsentLedger } from '@pooriaarab/vibe-core';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* vibedating — dating by token usage.
|
|
6
|
+
*
|
|
7
|
+
* v0 library surface: league bucketing, local usage reading, and in-league
|
|
8
|
+
* matching against a seeded set of candidate profiles. Raw usage never leaves
|
|
9
|
+
* the machine; only the league bucket is shared.
|
|
10
|
+
*
|
|
11
|
+
* Builds on `@pooriaarab/vibe-core` (UsageSnapshot / Harness / consent ledger).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A usage league (volume bucket). `max` is inclusive; the top tier is open-ended
|
|
16
|
+
* (Number.POSITIVE_INFINITY).
|
|
17
|
+
*/
|
|
18
|
+
interface League {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly min: number;
|
|
21
|
+
readonly max: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The five real leagues, in ascending order. (Accounts below 1M are reported as
|
|
25
|
+
* {@link BELOW_LEAGUE} — not a real league, but adjacent to the 1M tier.)
|
|
26
|
+
*/
|
|
27
|
+
declare const LEAGUES: readonly League[];
|
|
28
|
+
/** League name for accounts that haven't crossed the first threshold yet. */
|
|
29
|
+
declare const BELOW_LEAGUE = "below-1M";
|
|
30
|
+
/**
|
|
31
|
+
* Bucket a lifetime token count into a league. Pure: same input → same output.
|
|
32
|
+
*
|
|
33
|
+
* Returns `{ name, min }`. For counts below 1M the name is {@link BELOW_LEAGUE}
|
|
34
|
+
* with `min: 0`. Non-negative only; negatives are clamped to 0. Non-integers are
|
|
35
|
+
* floored (so 999_999.9 → below-1M, 1_000_000.9 → 1M).
|
|
36
|
+
*/
|
|
37
|
+
declare function league(totalTokens: number): {
|
|
38
|
+
name: string;
|
|
39
|
+
min: number;
|
|
40
|
+
};
|
|
41
|
+
/** Index of a league name in {@link LEAGUES}; {@link BELOW_LEAGUE} → -1. */
|
|
42
|
+
declare function leagueIndex(name: string): number;
|
|
43
|
+
/** Env var that holds a self-reported total token count (e.g. `23400000`). */
|
|
44
|
+
declare const TOKENS_ENV = "VIBEDATING_TOKENS";
|
|
45
|
+
/**
|
|
46
|
+
* Demo total used when there is no real read and no env value, so `connect` and
|
|
47
|
+
* the local web app work out of the box. Lands in the 10M league.
|
|
48
|
+
*/
|
|
49
|
+
declare const DEMO_TOTAL_TOKENS = 23400000;
|
|
50
|
+
/**
|
|
51
|
+
* v0 usage reader. Resolution order:
|
|
52
|
+
*
|
|
53
|
+
* 1. (future) read-only OAuth → `verified: true`. **NOT implemented in v0** —
|
|
54
|
+
* see {@link tryReadVerifiedUsage}. This arm is the deliberate seam.
|
|
55
|
+
* 2. a self-reported value from the {@link TOKENS_ENV} env var → `verified: false`.
|
|
56
|
+
* 3. the demo value {@link DEMO_TOTAL_TOKENS} → `verified: false`.
|
|
57
|
+
*
|
|
58
|
+
* The snapshot's `totalTokens` is the only thing that must never leave the
|
|
59
|
+
* machine; everything downstream consumes only the league bucket.
|
|
60
|
+
*/
|
|
61
|
+
declare function readUsage(harness?: Harness): Promise<UsageSnapshot>;
|
|
62
|
+
/**
|
|
63
|
+
* Future home of read-only OAuth verification. Returns `null` in v0.
|
|
64
|
+
*
|
|
65
|
+
* Implementing this (reading a real, provider-attested usage scope) flips the
|
|
66
|
+
* snapshot to `verified: true` and is what makes the league trustworthy. Kept as
|
|
67
|
+
* an explicit, named seam rather than a TODO comment so the privacy contract is
|
|
68
|
+
* visible at the call site.
|
|
69
|
+
*/
|
|
70
|
+
declare function tryReadVerifiedUsage(_harness: Harness): Promise<UsageSnapshot | null>;
|
|
71
|
+
/**
|
|
72
|
+
* Parse a self-reported token count: a plain integer (`23400000`), or a suffixed
|
|
73
|
+
* value (`12M`, `1.2B`, `500k`, `500K`). Returns `undefined` for anything that is
|
|
74
|
+
* not a non-negative finite number, so callers can fall through to a default.
|
|
75
|
+
*/
|
|
76
|
+
declare function parseTokensEnv(raw: string | undefined): number | undefined;
|
|
77
|
+
/** A seeded candidate profile for the local demo (no real directory in v0). */
|
|
78
|
+
interface Candidate {
|
|
79
|
+
readonly handle: string;
|
|
80
|
+
readonly league: string;
|
|
81
|
+
readonly bio: readonly string[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Seeded demo pool. In v0 there is no central directory — these profiles live
|
|
85
|
+
* locally only. Handles are abstract (no real identities); bios are flavor.
|
|
86
|
+
*/
|
|
87
|
+
declare const CANDIDATES: readonly Candidate[];
|
|
88
|
+
/**
|
|
89
|
+
* Filter `candidates` to the same league as `myLeague` or an adjacent one.
|
|
90
|
+
*
|
|
91
|
+
* "Adjacent" = exactly one tier above or below in {@link LEAGUES}, which keeps
|
|
92
|
+
* the top of the ladder (1B+) from being an empty pool and lets newcomers
|
|
93
|
+
* (below-1M) still see the 1M tier. Unknown league names never match. Pure and
|
|
94
|
+
* order-preserving.
|
|
95
|
+
*/
|
|
96
|
+
declare function matches(myLeague: string, candidates?: readonly Candidate[]): Candidate[];
|
|
97
|
+
|
|
98
|
+
export { BELOW_LEAGUE, CANDIDATES, type Candidate, DEMO_TOTAL_TOKENS, LEAGUES, type League, TOKENS_ENV, league, leagueIndex, matches, parseTokensEnv, readUsage, tryReadVerifiedUsage };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
BELOW_LEAGUE,
|
|
3
|
+
CANDIDATES,
|
|
4
|
+
DEMO_TOTAL_TOKENS,
|
|
5
|
+
LEAGUES,
|
|
6
|
+
TOKENS_ENV,
|
|
7
|
+
createConsentLedger,
|
|
8
|
+
league,
|
|
9
|
+
leagueIndex,
|
|
10
|
+
matches,
|
|
11
|
+
parseTokensEnv,
|
|
12
|
+
readUsage,
|
|
13
|
+
tryReadVerifiedUsage
|
|
14
|
+
} from "./chunk-AU7FN2LY.js";
|
|
15
|
+
export {
|
|
16
|
+
BELOW_LEAGUE,
|
|
17
|
+
CANDIDATES,
|
|
18
|
+
DEMO_TOTAL_TOKENS,
|
|
19
|
+
LEAGUES,
|
|
20
|
+
TOKENS_ENV,
|
|
21
|
+
createConsentLedger,
|
|
22
|
+
league,
|
|
23
|
+
leagueIndex,
|
|
24
|
+
matches,
|
|
25
|
+
parseTokensEnv,
|
|
26
|
+
readUsage,
|
|
27
|
+
tryReadVerifiedUsage
|
|
28
|
+
};
|
package/dist/mcp.d.ts
ADDED
package/dist/mcp.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vibedate",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Dating by tokens — matched by usage league across agentic CLIs. Raw usage stays local; only your league is shared. CLI + local web app + MCP. Local-first.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Pooria Arab",
|
|
8
|
+
"bin": {
|
|
9
|
+
"vibedating": "./dist/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsup src/index.ts src/cli.ts src/mcp.ts --format esm --dts --clean",
|
|
24
|
+
"typecheck": "tsc --noEmit",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@pooriaarab/vibe-core": "^0.1.0",
|
|
30
|
+
"@modelcontextprotocol/sdk": "^1.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.11.0",
|
|
34
|
+
"tsup": "^8.0.0",
|
|
35
|
+
"typescript": "^5.4.0",
|
|
36
|
+
"vitest": "^1.6.0"
|
|
37
|
+
},
|
|
38
|
+
"homepage": "https://github.com/pooriaarab/vibedating#readme",
|
|
39
|
+
"repository": {
|
|
40
|
+
"type": "git",
|
|
41
|
+
"url": "git+https://github.com/pooriaarab/vibedating.git"
|
|
42
|
+
},
|
|
43
|
+
"bugs": {
|
|
44
|
+
"url": "https://github.com/pooriaarab/vibedating/issues"
|
|
45
|
+
},
|
|
46
|
+
"keywords": [
|
|
47
|
+
"vibe-suite",
|
|
48
|
+
"vibedating",
|
|
49
|
+
"claude-code",
|
|
50
|
+
"codex",
|
|
51
|
+
"agentic",
|
|
52
|
+
"cli",
|
|
53
|
+
"mcp",
|
|
54
|
+
"tokens",
|
|
55
|
+
"local-first"
|
|
56
|
+
],
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=18"
|
|
62
|
+
}
|
|
63
|
+
}
|