hacklab 0.22.2 → 26.921.1
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/README.md +23 -430
- package/dist/index.js +132 -23
- package/package.json +20 -42
- package/LICENSE +0 -21
- package/dist/agent-handoff.d.ts +0 -51
- package/dist/agent-handoff.d.ts.map +0 -1
- package/dist/agent-handoff.js +0 -91
- package/dist/agent-handoff.js.map +0 -1
- package/dist/api-client.d.ts +0 -18
- package/dist/api-client.d.ts.map +0 -1
- package/dist/api-client.js +0 -40
- package/dist/api-client.js.map +0 -1
- package/dist/belt.d.ts +0 -25
- package/dist/belt.d.ts.map +0 -1
- package/dist/belt.js +0 -113
- package/dist/belt.js.map +0 -1
- package/dist/card.d.ts +0 -66
- package/dist/card.d.ts.map +0 -1
- package/dist/card.js +0 -151
- package/dist/card.js.map +0 -1
- package/dist/cli.d.ts +0 -2
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -238
- package/dist/cli.js.map +0 -1
- package/dist/commands/book.d.ts +0 -14
- package/dist/commands/book.d.ts.map +0 -1
- package/dist/commands/book.js +0 -90
- package/dist/commands/book.js.map +0 -1
- package/dist/commands/chat.d.ts +0 -36
- package/dist/commands/chat.d.ts.map +0 -1
- package/dist/commands/chat.js +0 -642
- package/dist/commands/chat.js.map +0 -1
- package/dist/commands/config.d.ts +0 -2
- package/dist/commands/config.d.ts.map +0 -1
- package/dist/commands/config.js +0 -84
- package/dist/commands/config.js.map +0 -1
- package/dist/commands/daemon.d.ts +0 -19
- package/dist/commands/daemon.d.ts.map +0 -1
- package/dist/commands/daemon.js +0 -72
- package/dist/commands/daemon.js.map +0 -1
- package/dist/commands/drop.d.ts +0 -12
- package/dist/commands/drop.d.ts.map +0 -1
- package/dist/commands/drop.js +0 -103
- package/dist/commands/drop.js.map +0 -1
- package/dist/commands/drops.d.ts +0 -9
- package/dist/commands/drops.d.ts.map +0 -1
- package/dist/commands/drops.js +0 -96
- package/dist/commands/drops.js.map +0 -1
- package/dist/commands/essay.d.ts +0 -40
- package/dist/commands/essay.d.ts.map +0 -1
- package/dist/commands/essay.js +0 -651
- package/dist/commands/essay.js.map +0 -1
- package/dist/commands/hackathon.d.ts +0 -2
- package/dist/commands/hackathon.d.ts.map +0 -1
- package/dist/commands/hackathon.js +0 -893
- package/dist/commands/hackathon.js.map +0 -1
- package/dist/commands/hacker.d.ts +0 -2
- package/dist/commands/hacker.d.ts.map +0 -1
- package/dist/commands/hacker.js +0 -87
- package/dist/commands/hacker.js.map +0 -1
- package/dist/commands/jobs.d.ts +0 -18
- package/dist/commands/jobs.d.ts.map +0 -1
- package/dist/commands/jobs.js +0 -138
- package/dist/commands/jobs.js.map +0 -1
- package/dist/commands/keys.d.ts +0 -2
- package/dist/commands/keys.d.ts.map +0 -1
- package/dist/commands/keys.js +0 -138
- package/dist/commands/keys.js.map +0 -1
- package/dist/commands/login.d.ts +0 -83
- package/dist/commands/login.d.ts.map +0 -1
- package/dist/commands/login.js +0 -236
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -2
- package/dist/commands/logout.d.ts.map +0 -1
- package/dist/commands/logout.js +0 -22
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/org-jobs.d.ts +0 -50
- package/dist/commands/org-jobs.d.ts.map +0 -1
- package/dist/commands/org-jobs.js +0 -383
- package/dist/commands/org-jobs.js.map +0 -1
- package/dist/commands/org.d.ts +0 -67
- package/dist/commands/org.d.ts.map +0 -1
- package/dist/commands/org.js +0 -1244
- package/dist/commands/org.js.map +0 -1
- package/dist/commands/ping.d.ts +0 -2
- package/dist/commands/ping.d.ts.map +0 -1
- package/dist/commands/ping.js +0 -50
- package/dist/commands/ping.js.map +0 -1
- package/dist/commands/profile.d.ts +0 -72
- package/dist/commands/profile.d.ts.map +0 -1
- package/dist/commands/profile.js +0 -672
- package/dist/commands/profile.js.map +0 -1
- package/dist/commands/project.d.ts +0 -2
- package/dist/commands/project.d.ts.map +0 -1
- package/dist/commands/project.js +0 -583
- package/dist/commands/project.js.map +0 -1
- package/dist/commands/referral.d.ts +0 -6
- package/dist/commands/referral.d.ts.map +0 -1
- package/dist/commands/referral.js +0 -93
- package/dist/commands/referral.js.map +0 -1
- package/dist/commands/rtfm.d.ts +0 -9
- package/dist/commands/rtfm.d.ts.map +0 -1
- package/dist/commands/rtfm.js +0 -114
- package/dist/commands/rtfm.js.map +0 -1
- package/dist/commands/scan.d.ts +0 -13
- package/dist/commands/scan.d.ts.map +0 -1
- package/dist/commands/scan.js +0 -286
- package/dist/commands/scan.js.map +0 -1
- package/dist/commands/scout.d.ts +0 -18
- package/dist/commands/scout.d.ts.map +0 -1
- package/dist/commands/scout.js +0 -232
- package/dist/commands/scout.js.map +0 -1
- package/dist/commands/setup-rail.d.ts +0 -58
- package/dist/commands/setup-rail.d.ts.map +0 -1
- package/dist/commands/setup-rail.js +0 -135
- package/dist/commands/setup-rail.js.map +0 -1
- package/dist/commands/setup.d.ts +0 -29
- package/dist/commands/setup.d.ts.map +0 -1
- package/dist/commands/setup.js +0 -442
- package/dist/commands/setup.js.map +0 -1
- package/dist/commands/sync.d.ts +0 -9
- package/dist/commands/sync.d.ts.map +0 -1
- package/dist/commands/sync.js +0 -345
- package/dist/commands/sync.js.map +0 -1
- package/dist/commands/update.d.ts +0 -2
- package/dist/commands/update.d.ts.map +0 -1
- package/dist/commands/update.js +0 -92
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -2
- package/dist/commands/whoami.d.ts.map +0 -1
- package/dist/commands/whoami.js +0 -41
- package/dist/commands/whoami.js.map +0 -1
- package/dist/config.d.ts +0 -78
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -93
- package/dist/config.js.map +0 -1
- package/dist/daily-sync.d.ts +0 -150
- package/dist/daily-sync.d.ts.map +0 -1
- package/dist/daily-sync.js +0 -665
- package/dist/daily-sync.js.map +0 -1
- package/dist/dossier.d.ts +0 -73
- package/dist/dossier.d.ts.map +0 -1
- package/dist/dossier.js +0 -141
- package/dist/dossier.js.map +0 -1
- package/dist/field-normalize.d.ts +0 -4
- package/dist/field-normalize.d.ts.map +0 -1
- package/dist/field-normalize.js +0 -8
- package/dist/field-normalize.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/job-fields.d.ts +0 -47
- package/dist/job-fields.d.ts.map +0 -1
- package/dist/job-fields.js +0 -148
- package/dist/job-fields.js.map +0 -1
- package/dist/machine.d.ts +0 -15
- package/dist/machine.d.ts.map +0 -1
- package/dist/machine.js +0 -64
- package/dist/machine.js.map +0 -1
- package/dist/org-fields.d.ts +0 -57
- package/dist/org-fields.d.ts.map +0 -1
- package/dist/org-fields.js +0 -167
- package/dist/org-fields.js.map +0 -1
- package/dist/posthog.d.ts +0 -38
- package/dist/posthog.d.ts.map +0 -1
- package/dist/posthog.js +0 -224
- package/dist/posthog.js.map +0 -1
- package/dist/project-fields.d.ts +0 -40
- package/dist/project-fields.d.ts.map +0 -1
- package/dist/project-fields.js +0 -79
- package/dist/project-fields.js.map +0 -1
- package/dist/prompt-consent.d.ts +0 -73
- package/dist/prompt-consent.d.ts.map +0 -1
- package/dist/prompt-consent.js +0 -191
- package/dist/prompt-consent.js.map +0 -1
- package/dist/prompt-stats.d.ts +0 -226
- package/dist/prompt-stats.d.ts.map +0 -1
- package/dist/prompt-stats.js +0 -561
- package/dist/prompt-stats.js.map +0 -1
- package/dist/referral.d.ts +0 -14
- package/dist/referral.d.ts.map +0 -1
- package/dist/referral.js +0 -28
- package/dist/referral.js.map +0 -1
- package/dist/registry.d.ts +0 -15
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -180
- package/dist/registry.js.map +0 -1
- package/dist/resolve-command.d.ts +0 -20
- package/dist/resolve-command.d.ts.map +0 -1
- package/dist/resolve-command.js +0 -21
- package/dist/resolve-command.js.map +0 -1
- package/dist/scanners/antigravity.d.ts +0 -41
- package/dist/scanners/antigravity.d.ts.map +0 -1
- package/dist/scanners/antigravity.js +0 -210
- package/dist/scanners/antigravity.js.map +0 -1
- package/dist/scanners/github-copilot-telemetry.d.ts +0 -23
- package/dist/scanners/github-copilot-telemetry.d.ts.map +0 -1
- package/dist/scanners/github-copilot-telemetry.js +0 -220
- package/dist/scanners/github-copilot-telemetry.js.map +0 -1
- package/dist/scanners/github-copilot.d.ts +0 -68
- package/dist/scanners/github-copilot.d.ts.map +0 -1
- package/dist/scanners/github-copilot.js +0 -262
- package/dist/scanners/github-copilot.js.map +0 -1
- package/dist/scanners/incremental.d.ts +0 -282
- package/dist/scanners/incremental.d.ts.map +0 -1
- package/dist/scanners/incremental.js +0 -788
- package/dist/scanners/incremental.js.map +0 -1
- package/dist/scanners/index.d.ts +0 -116
- package/dist/scanners/index.d.ts.map +0 -1
- package/dist/scanners/index.js +0 -726
- package/dist/scanners/index.js.map +0 -1
- package/dist/scanners/sqlite.d.ts +0 -18
- package/dist/scanners/sqlite.d.ts.map +0 -1
- package/dist/scanners/sqlite.js +0 -63
- package/dist/scanners/sqlite.js.map +0 -1
- package/dist/scanners/util.d.ts +0 -112
- package/dist/scanners/util.d.ts.map +0 -1
- package/dist/scanners/util.js +0 -167
- package/dist/scanners/util.js.map +0 -1
- package/dist/session.d.ts +0 -106
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -191
- package/dist/session.js.map +0 -1
- package/dist/share-card-colors.d.ts +0 -19
- package/dist/share-card-colors.d.ts.map +0 -1
- package/dist/share-card-colors.js +0 -36
- package/dist/share-card-colors.js.map +0 -1
- package/dist/share-card.d.ts +0 -32
- package/dist/share-card.d.ts.map +0 -1
- package/dist/share-card.js +0 -420
- package/dist/share-card.js.map +0 -1
- package/dist/share.d.ts +0 -17
- package/dist/share.d.ts.map +0 -1
- package/dist/share.js +0 -77
- package/dist/share.js.map +0 -1
- package/dist/sync.d.ts +0 -100
- package/dist/sync.d.ts.map +0 -1
- package/dist/sync.js +0 -304
- package/dist/sync.js.map +0 -1
- package/dist/ui.d.ts +0 -33
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -127
- package/dist/ui.js.map +0 -1
- package/dist/utils/npmGlobal.d.ts +0 -30
- package/dist/utils/npmGlobal.d.ts.map +0 -1
- package/dist/utils/npmGlobal.js +0 -69
- package/dist/utils/npmGlobal.js.map +0 -1
- package/dist/utils/openBrowser.d.ts +0 -14
- package/dist/utils/openBrowser.d.ts.map +0 -1
- package/dist/utils/openBrowser.js +0 -47
- package/dist/utils/openBrowser.js.map +0 -1
- package/dist/utils/updateCheck.d.ts +0 -16
- package/dist/utils/updateCheck.d.ts.map +0 -1
- package/dist/utils/updateCheck.js +0 -111
- package/dist/utils/updateCheck.js.map +0 -1
- package/dist/utils/waitForEnter.d.ts +0 -12
- package/dist/utils/waitForEnter.d.ts.map +0 -1
- package/dist/utils/waitForEnter.js +0 -43
- package/dist/utils/waitForEnter.js.map +0 -1
package/dist/prompt-stats.js
DELETED
|
@@ -1,561 +0,0 @@
|
|
|
1
|
-
import { execFile } from 'node:child_process';
|
|
2
|
-
import { readFile, stat } from 'node:fs/promises';
|
|
3
|
-
import { homedir } from 'node:os';
|
|
4
|
-
import { dirname, join } from 'node:path';
|
|
5
|
-
import { promisify } from 'node:util';
|
|
6
|
-
import { antigravityTranscriptFiles, scanAntigravityPrompts, } from './scanners/antigravity.js';
|
|
7
|
-
import { githubCopilotFiles, scanGitHubCopilotPrompts, } from './scanners/github-copilot.js';
|
|
8
|
-
import { findFiles, toDateStr } from './scanners/util.js';
|
|
9
|
-
/**
|
|
10
|
-
* Prompt statistics, computed on this machine from supported local harness
|
|
11
|
-
* transcripts and uploaded only under an explicit consent tier (see
|
|
12
|
-
* prompt-consent.ts).
|
|
13
|
-
*
|
|
14
|
-
* Three things come out of a full scan:
|
|
15
|
-
*
|
|
16
|
-
* - a histogram of how long the user's own prompts are, in words — every
|
|
17
|
-
* bucket an exact word count — plus the tail, which is where the prompts
|
|
18
|
-
* longer than the axis are reported, and their only home
|
|
19
|
-
* - a per-project prompt count, keyed by the project's git origin
|
|
20
|
-
* - the prompt *activity* aggregate: per-session start/end/count and a
|
|
21
|
-
* per-day prompt/word tally. That one is also what the minutely tick
|
|
22
|
-
* accumulates incrementally (scanners/incremental.ts), so a full scan can
|
|
23
|
-
* re-base the tick's state without either drifting from the other.
|
|
24
|
-
*
|
|
25
|
-
* and, under the `full` tier only, a sample of the raw prompt text so the
|
|
26
|
-
* backend can score "how technical is this person's prompting". The backend
|
|
27
|
-
* scores that sample and throws it away; it is never stored.
|
|
28
|
-
*
|
|
29
|
-
* Everything here is deliberately best-effort: an unreadable transcript, a
|
|
30
|
-
* project that isn't a git repo, a missing `git` binary — each drops its own
|
|
31
|
-
* contribution and the rest of the scan still uploads.
|
|
32
|
-
*/
|
|
33
|
-
const execFileAsync = promisify(execFile);
|
|
34
|
-
/** Buckets are `1..bucketMax`, so the axis stays readable at any prompt length. */
|
|
35
|
-
export const PROMPT_LENGTH_BUCKET_MIN = 10;
|
|
36
|
-
export const PROMPT_LENGTH_BUCKET_MAX = 100;
|
|
37
|
-
/** The percentile that sets `bucketMax`; everything above it lands in `tail`. */
|
|
38
|
-
export const PROMPT_LENGTH_AXIS_PERCENTILE = 0.9;
|
|
39
|
-
/** The server's cap on `tail` entries; longer distributions are coarsened. */
|
|
40
|
-
export const PROMPT_TAIL_MAX_ENTRIES = 400;
|
|
41
|
-
/** Matches the backend's cap — anything longer is truncated before upload. */
|
|
42
|
-
export const CONVERSATION_SAMPLE_MAX_CHARS = 20_000;
|
|
43
|
-
/**
|
|
44
|
-
* Which definition of "a prompt the user typed" produced this upload.
|
|
45
|
-
*
|
|
46
|
-
* Version 1 is implicit — every CLI shipped before this field existed counted
|
|
47
|
-
* harness-generated `user` entries (subagent task notifications, skill bodies,
|
|
48
|
-
* slash-command echoes, interrupt markers) as prompts, which inflated the
|
|
49
|
-
* counts and blew out the word tallies. Version 2 is the scan with
|
|
50
|
-
* `isHarnessNoise` in it.
|
|
51
|
-
*
|
|
52
|
-
* It rides on every sync as a top-level `scannerVersion`; the server ignores
|
|
53
|
-
* `promptStats` / `promptActivity` from anything below 2, so an un-upgraded CLI
|
|
54
|
-
* can't keep writing the old numbers into a table that was wiped to fix them.
|
|
55
|
-
*/
|
|
56
|
-
export const PROMPT_SCANNER_VERSION = 2;
|
|
57
|
-
/**
|
|
58
|
-
* Prefixes that mark a `user` transcript entry as written by Claude Code
|
|
59
|
-
* itself rather than typed by the person at the keyboard.
|
|
60
|
-
*
|
|
61
|
-
* These all arrive in exactly the shape a real prompt does — `type: 'user'`,
|
|
62
|
-
* not a sidechain, content a plain string or `text` blocks — so nothing but the
|
|
63
|
-
* text tells them apart. Measured over 194 local transcripts they were 39% of
|
|
64
|
-
* everything the scan called a prompt and 65% of its words, because a machine's
|
|
65
|
-
* report or an injected skill body is an order of magnitude longer than
|
|
66
|
-
* anything a human types.
|
|
67
|
-
*
|
|
68
|
-
* Matched against the entry's text after `trimStart()`, and anchored to the
|
|
69
|
-
* start on purpose: a prompt that *quotes* one of these tags mid-sentence
|
|
70
|
-
* ("why does <command-name> show up twice?") is a real prompt and still counts.
|
|
71
|
-
*/
|
|
72
|
-
const HARNESS_NOISE_PREFIXES = [
|
|
73
|
-
// The body of a skill, injected when one is invoked. Up to ~11.5k words.
|
|
74
|
-
'Base directory for this skill:',
|
|
75
|
-
// A background subagent's report, handed back as a user turn: ~400 words
|
|
76
|
-
// each and the single largest source of fake prompts.
|
|
77
|
-
'<task-notification>',
|
|
78
|
-
// The wrapper around a slash command's expansion, its echo and its output.
|
|
79
|
-
'<local-command-caveat>',
|
|
80
|
-
'<command-name>',
|
|
81
|
-
'<command-message>',
|
|
82
|
-
'<command-args>',
|
|
83
|
-
'<local-command-stdout>',
|
|
84
|
-
// Context the harness injects into a turn. Nobody types it.
|
|
85
|
-
'<system-reminder>',
|
|
86
|
-
// Written when the user hits escape — the absence of a prompt, not one.
|
|
87
|
-
'[Request interrupted',
|
|
88
|
-
// `!`-prefixed bash mode: the command and whatever it printed.
|
|
89
|
-
'<bash-input>',
|
|
90
|
-
'<bash-stdout>',
|
|
91
|
-
'<bash-stderr>',
|
|
92
|
-
// Text a UserPromptSubmit hook appended to the turn.
|
|
93
|
-
'<user-prompt-submit-hook>',
|
|
94
|
-
];
|
|
95
|
-
/**
|
|
96
|
-
* Is this entry text something the harness wrote rather than the user?
|
|
97
|
-
*
|
|
98
|
-
* Deliberately a prefix test and nothing more — no stripping of inline
|
|
99
|
-
* `<system-reminder>` blocks out of otherwise-typed prompts. Those measured at
|
|
100
|
-
* zero words of real contribution, and rewriting prompt text in place is a
|
|
101
|
-
* bigger risk than the noise it would remove.
|
|
102
|
-
*/
|
|
103
|
-
export function isHarnessNoise(text) {
|
|
104
|
-
const start = text.trimStart();
|
|
105
|
-
return HARNESS_NOISE_PREFIXES.some((prefix) => start.startsWith(prefix));
|
|
106
|
-
}
|
|
107
|
-
/** Prompt-only sources: no token estimates and no token harness registration. */
|
|
108
|
-
export const IDE_PROMPT_SOURCES = [
|
|
109
|
-
{
|
|
110
|
-
id: 'antigravity',
|
|
111
|
-
files: antigravityTranscriptFiles,
|
|
112
|
-
scan: scanAntigravityPrompts,
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'github_copilot',
|
|
116
|
-
files: githubCopilotFiles,
|
|
117
|
-
scan: scanGitHubCopilotPrompts,
|
|
118
|
-
},
|
|
119
|
-
];
|
|
120
|
-
export function mergePromptActivities(sources) {
|
|
121
|
-
const merged = emptyPromptActivity();
|
|
122
|
-
for (const source of sources) {
|
|
123
|
-
for (const [id, session] of Object.entries(source.sessions)) {
|
|
124
|
-
merged.sessions[id] = { ...session };
|
|
125
|
-
}
|
|
126
|
-
for (const [date, day] of Object.entries(source.daily)) {
|
|
127
|
-
merged.daily[date] ??= { prompts: 0, words: 0 };
|
|
128
|
-
const target = merged.daily[date];
|
|
129
|
-
target.prompts += day.prompts;
|
|
130
|
-
target.words += day.words;
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
return merged;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* The user's own prompt text from one transcript line, or null when the line
|
|
137
|
-
* isn't one.
|
|
138
|
-
*
|
|
139
|
-
* A transcript's `user` entries cover more than typed prompts: tool results
|
|
140
|
-
* come back as synthetic user turns too. Those carry `tool_result` content
|
|
141
|
-
* blocks, so a line only counts when its content is a plain string or an array
|
|
142
|
-
* of nothing but `text` blocks. Sidechain entries (subagent conversations) are
|
|
143
|
-
* the agent talking to itself, not the person typing, so they're excluded.
|
|
144
|
-
*
|
|
145
|
-
* That still leaves the harness's own writing, which is indistinguishable by
|
|
146
|
-
* shape: subagent reports, injected skill bodies, slash-command echoes,
|
|
147
|
-
* interrupt markers. Those are dropped two ways — `isMeta`, which Claude Code
|
|
148
|
-
* sets on the entries it generates, and the text prefixes in
|
|
149
|
-
* `isHarnessNoise` for the ones it doesn't.
|
|
150
|
-
*
|
|
151
|
-
* This is the single chokepoint: both the full scan and the minutely tick go
|
|
152
|
-
* through here, so the histogram, the tail, the per-project counts, the
|
|
153
|
-
* activity aggregate and the technical-score sample all see the same prompts.
|
|
154
|
-
*/
|
|
155
|
-
export function promptTextFrom(entry) {
|
|
156
|
-
if (!entry || typeof entry !== 'object')
|
|
157
|
-
return null;
|
|
158
|
-
const line = entry;
|
|
159
|
-
if (line.type !== 'user')
|
|
160
|
-
return null;
|
|
161
|
-
if (line.isSidechain === true)
|
|
162
|
-
return null;
|
|
163
|
-
if (line.isMeta === true)
|
|
164
|
-
return null;
|
|
165
|
-
const content = line.message?.content;
|
|
166
|
-
if (typeof content === 'string') {
|
|
167
|
-
return isHarnessNoise(content) ? null : content;
|
|
168
|
-
}
|
|
169
|
-
if (!Array.isArray(content))
|
|
170
|
-
return null;
|
|
171
|
-
const texts = [];
|
|
172
|
-
for (const block of content) {
|
|
173
|
-
if (!block || typeof block !== 'object')
|
|
174
|
-
return null;
|
|
175
|
-
const { type, text } = block;
|
|
176
|
-
// One non-text block (a tool_result, an image) disqualifies the whole
|
|
177
|
-
// entry: it isn't a prompt the person typed.
|
|
178
|
-
if (type !== 'text' || typeof text !== 'string')
|
|
179
|
-
return null;
|
|
180
|
-
texts.push(text);
|
|
181
|
-
}
|
|
182
|
-
if (texts.length === 0)
|
|
183
|
-
return null;
|
|
184
|
-
const joined = texts.join('\n');
|
|
185
|
-
return isHarnessNoise(joined) ? null : joined;
|
|
186
|
-
}
|
|
187
|
-
/** Whitespace-separated word count. Zero-word prompts are dropped by callers. */
|
|
188
|
-
export function countWords(text) {
|
|
189
|
-
const matches = text.match(/\S+/g);
|
|
190
|
-
return matches ? matches.length : 0;
|
|
191
|
-
}
|
|
192
|
-
/** The server's cap on a session id. Longer than this and the row is rejected. */
|
|
193
|
-
export const PROMPT_SESSION_ID_MAX_CHARS = 128;
|
|
194
|
-
/**
|
|
195
|
-
* A transcript line as prompt activity, or null when it isn't one.
|
|
196
|
-
*
|
|
197
|
-
* Stricter than `promptTextFrom` on purpose: a prompt with no session id or no
|
|
198
|
-
* usable timestamp can't be placed on a session or a day, and the server's
|
|
199
|
-
* schema would reject it, so it counts towards the histogram (which needs
|
|
200
|
-
* neither) and nothing else.
|
|
201
|
-
*/
|
|
202
|
-
export function parsePromptLine(line) {
|
|
203
|
-
if (!line.trim())
|
|
204
|
-
return null;
|
|
205
|
-
let parsed;
|
|
206
|
-
try {
|
|
207
|
-
parsed = JSON.parse(line);
|
|
208
|
-
}
|
|
209
|
-
catch {
|
|
210
|
-
return null;
|
|
211
|
-
}
|
|
212
|
-
const text = promptTextFrom(parsed);
|
|
213
|
-
if (text === null)
|
|
214
|
-
return null;
|
|
215
|
-
const words = countWords(text);
|
|
216
|
-
if (words <= 0)
|
|
217
|
-
return null;
|
|
218
|
-
const entry = parsed;
|
|
219
|
-
const sessionId = typeof entry.sessionId === 'string' ? entry.sessionId.trim() : '';
|
|
220
|
-
if (!sessionId || sessionId.length > PROMPT_SESSION_ID_MAX_CHARS)
|
|
221
|
-
return null;
|
|
222
|
-
const timestamp = normalizeTimestamp(entry.timestamp);
|
|
223
|
-
if (!timestamp)
|
|
224
|
-
return null;
|
|
225
|
-
return { sessionId, timestamp, words };
|
|
226
|
-
}
|
|
227
|
-
/** An ISO-8601 UTC string, or null when the value isn't a usable instant. */
|
|
228
|
-
export function normalizeTimestamp(value) {
|
|
229
|
-
if (typeof value !== 'string' && typeof value !== 'number')
|
|
230
|
-
return null;
|
|
231
|
-
const at = typeof value === 'number' ? value : Date.parse(value);
|
|
232
|
-
const date = new Date(at);
|
|
233
|
-
return Number.isFinite(date.getTime()) ? date.toISOString() : null;
|
|
234
|
-
}
|
|
235
|
-
export function emptyPromptActivity() {
|
|
236
|
-
return { sessions: {}, daily: {} };
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* Fold one prompt into an activity aggregate, returning the session and date it
|
|
240
|
-
* landed on so an incremental caller can mark exactly those dirty.
|
|
241
|
-
*
|
|
242
|
-
* The date is the UTC day of the timestamp — the same attribution
|
|
243
|
-
* `toDateStr` gives every token daily row, so the two halves of a sync agree
|
|
244
|
-
* about which day a piece of work belongs to.
|
|
245
|
-
*/
|
|
246
|
-
export function addPromptToActivity(activity, line) {
|
|
247
|
-
const session = activity.sessions[line.sessionId];
|
|
248
|
-
if (session) {
|
|
249
|
-
if (line.timestamp < session.startedAt)
|
|
250
|
-
session.startedAt = line.timestamp;
|
|
251
|
-
if (line.timestamp > session.lastActiveAt) {
|
|
252
|
-
session.lastActiveAt = line.timestamp;
|
|
253
|
-
}
|
|
254
|
-
session.promptCount += 1;
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
activity.sessions[line.sessionId] = {
|
|
258
|
-
startedAt: line.timestamp,
|
|
259
|
-
lastActiveAt: line.timestamp,
|
|
260
|
-
promptCount: 1,
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
const date = toDateStr(line.timestamp);
|
|
264
|
-
const day = activity.daily[date];
|
|
265
|
-
if (day) {
|
|
266
|
-
day.prompts += 1;
|
|
267
|
-
day.words += line.words;
|
|
268
|
-
}
|
|
269
|
-
else {
|
|
270
|
-
activity.daily[date] = { prompts: 1, words: line.words };
|
|
271
|
-
}
|
|
272
|
-
return { sessionId: line.sessionId, date };
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* Where the histogram's axis ends for this user's own distribution: their p90
|
|
276
|
-
* prompt length rounded up to a multiple of 10, clamped to [10, 100]. Anything
|
|
277
|
-
* longer is reported by `buildTail` instead.
|
|
278
|
-
*
|
|
279
|
-
* Per-user rather than fixed because prompt length varies enormously between
|
|
280
|
-
* people — a fixed axis would either crush a terse user's histogram into the
|
|
281
|
-
* first two buckets or run a verbose one off the end.
|
|
282
|
-
*/
|
|
283
|
-
export function bucketMaxFor(wordCounts) {
|
|
284
|
-
if (wordCounts.length === 0)
|
|
285
|
-
return PROMPT_LENGTH_BUCKET_MIN;
|
|
286
|
-
const sorted = [...wordCounts].sort((a, b) => a - b);
|
|
287
|
-
const index = Math.min(sorted.length - 1, Math.floor(sorted.length * PROMPT_LENGTH_AXIS_PERCENTILE));
|
|
288
|
-
const p90 = sorted[index] ?? PROMPT_LENGTH_BUCKET_MIN;
|
|
289
|
-
const rounded = Math.ceil(p90 / 10) * 10;
|
|
290
|
-
return Math.min(PROMPT_LENGTH_BUCKET_MAX, Math.max(PROMPT_LENGTH_BUCKET_MIN, rounded));
|
|
291
|
-
}
|
|
292
|
-
/**
|
|
293
|
-
* Bucket the word counts. Every bucket `1..bucketMax` is an exact word count —
|
|
294
|
-
* there is no overflow bar. Empty buckets are omitted; the chart fills the gaps.
|
|
295
|
-
*
|
|
296
|
-
* Prompts longer than `bucketMax` are not in here at all: they are reported by
|
|
297
|
-
* `buildTail`, and only there. So the histogram and the tail partition the
|
|
298
|
-
* scan — sum(histogram counts) + sum(tail counts) === totalPrompts, always.
|
|
299
|
-
*/
|
|
300
|
-
export function buildHistogram(wordCounts, bucketMax) {
|
|
301
|
-
const counts = new Map();
|
|
302
|
-
for (const words of wordCounts) {
|
|
303
|
-
if (words <= 0)
|
|
304
|
-
continue;
|
|
305
|
-
if (words > bucketMax)
|
|
306
|
-
continue;
|
|
307
|
-
counts.set(words, (counts.get(words) ?? 0) + 1);
|
|
308
|
-
}
|
|
309
|
-
return [...counts.entries()]
|
|
310
|
-
.map(([length, count]) => ({ length, count }))
|
|
311
|
-
.sort((a, b) => a.length - b.length);
|
|
312
|
-
}
|
|
313
|
-
/**
|
|
314
|
-
* The exact distribution of everything *longer* than `bucketMax`, which the
|
|
315
|
-
* histogram does not cover at all. One entry per distinct word count,
|
|
316
|
-
* ascending; empty (never absent) when nothing exceeds `bucketMax` — the
|
|
317
|
-
* field's presence on the wire is the marker that the histogram's bars are
|
|
318
|
-
* exact.
|
|
319
|
-
*
|
|
320
|
-
* Lengths only — no prompt text is involved here, or anywhere near it.
|
|
321
|
-
*
|
|
322
|
-
* A machine with a long history can have thousands of distinct long lengths,
|
|
323
|
-
* far past what the server accepts, so an over-cap tail is coarsened: lengths
|
|
324
|
-
* are rounded to multiples of 2, then 4, 8, … until at most
|
|
325
|
-
* `PROMPT_TAIL_MAX_ENTRIES` entries remain, summing the counts that collapse
|
|
326
|
-
* together. Rounding is *up* so that a coarsened entry still sits above
|
|
327
|
-
* `bucketMax` — rounding down could claim a length inside the histogram's own
|
|
328
|
-
* exact range for a prompt the histogram never counted.
|
|
329
|
-
*
|
|
330
|
-
* Deterministic: the result depends only on the multiset of word counts.
|
|
331
|
-
*/
|
|
332
|
-
export function buildTail(wordCounts, bucketMax) {
|
|
333
|
-
const exact = new Map();
|
|
334
|
-
for (const words of wordCounts) {
|
|
335
|
-
if (words <= bucketMax)
|
|
336
|
-
continue;
|
|
337
|
-
exact.set(words, (exact.get(words) ?? 0) + 1);
|
|
338
|
-
}
|
|
339
|
-
if (exact.size === 0)
|
|
340
|
-
return [];
|
|
341
|
-
let counts = exact;
|
|
342
|
-
let step = 1;
|
|
343
|
-
while (counts.size > PROMPT_TAIL_MAX_ENTRIES) {
|
|
344
|
-
step *= 2;
|
|
345
|
-
const coarser = new Map();
|
|
346
|
-
// Always coarsen from the exact counts, so the rounding is one clean
|
|
347
|
-
// division rather than a rounding of a rounding.
|
|
348
|
-
for (const [length, count] of exact) {
|
|
349
|
-
const rounded = Math.ceil(length / step) * step;
|
|
350
|
-
coarser.set(rounded, (coarser.get(rounded) ?? 0) + count);
|
|
351
|
-
}
|
|
352
|
-
counts = coarser;
|
|
353
|
-
}
|
|
354
|
-
return [...counts.entries()]
|
|
355
|
-
.map(([length, count]) => ({ length, count }))
|
|
356
|
-
.sort((a, b) => a.length - b.length);
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* The `origin` remote of the repo at `cwd`, or null when there isn't one (not
|
|
360
|
-
* a repo, no origin, no git binary, or the directory is gone). The URL is sent
|
|
361
|
-
* as-is; the backend normalizes it before matching against the user's own
|
|
362
|
-
* projects.
|
|
363
|
-
*/
|
|
364
|
-
export async function gitOriginUrl(cwd) {
|
|
365
|
-
try {
|
|
366
|
-
const { stdout } = await execFileAsync('git', ['-C', cwd, 'remote', 'get-url', 'origin'], { timeout: 5_000 });
|
|
367
|
-
const url = stdout.trim();
|
|
368
|
-
return url.length > 0 ? url : null;
|
|
369
|
-
}
|
|
370
|
-
catch {
|
|
371
|
-
return null;
|
|
372
|
-
}
|
|
373
|
-
}
|
|
374
|
-
/**
|
|
375
|
-
* Newest transcript first. The sample is meant to be the user's *recent*
|
|
376
|
-
* prompting, so the walk order has to be time order — the directory walk's own
|
|
377
|
-
* order is alphabetical and would hand the scorer whatever happens to sort
|
|
378
|
-
* first, which for a long-lived machine is usually a project abandoned years
|
|
379
|
-
* ago. A file we can't stat sorts last rather than dropping out.
|
|
380
|
-
*/
|
|
381
|
-
async function byMtimeDesc(paths) {
|
|
382
|
-
const stamped = await Promise.all(paths.map(async (path) => ({
|
|
383
|
-
path,
|
|
384
|
-
mtimeMs: await stat(path)
|
|
385
|
-
.then((s) => s.mtimeMs)
|
|
386
|
-
.catch(() => 0),
|
|
387
|
-
})));
|
|
388
|
-
return stamped.sort((a, b) => b.mtimeMs - a.mtimeMs).map((f) => f.path);
|
|
389
|
-
}
|
|
390
|
-
/**
|
|
391
|
-
* Scan local Claude Code and supported IDE/agent chat transcripts.
|
|
392
|
-
*
|
|
393
|
-
* `includeSample` gates the raw prompt text: only the `full` consent tier
|
|
394
|
-
* passes true, and the sample never touches disk here — it goes straight into
|
|
395
|
-
* the upload payload the caller builds.
|
|
396
|
-
*/
|
|
397
|
-
export async function scanPromptStats(options = {}) {
|
|
398
|
-
const root = join(homedir(), '.claude', 'projects');
|
|
399
|
-
const files = await byMtimeDesc(await findFiles(root, '.jsonl'));
|
|
400
|
-
const wordCounts = [];
|
|
401
|
-
const activity = emptyPromptActivity();
|
|
402
|
-
const samples = [];
|
|
403
|
-
let sampleChars = 0;
|
|
404
|
-
const addSample = (text, timestamp) => {
|
|
405
|
-
if (!options.includeSample)
|
|
406
|
-
return;
|
|
407
|
-
const at = timestamp ? Date.parse(timestamp) : 0;
|
|
408
|
-
const clipped = text.slice(0, CONVERSATION_SAMPLE_MAX_CHARS);
|
|
409
|
-
const index = samples.findIndex((sample) => sample.at < at);
|
|
410
|
-
samples.splice(index < 0 ? samples.length : index, 0, { text: clipped, at });
|
|
411
|
-
sampleChars += clipped.length + 2;
|
|
412
|
-
while (samples.length > 1) {
|
|
413
|
-
const oldest = samples.at(-1);
|
|
414
|
-
if (!oldest ||
|
|
415
|
-
sampleChars - (oldest.text.length + 2) < CONVERSATION_SAMPLE_MAX_CHARS)
|
|
416
|
-
break;
|
|
417
|
-
sampleChars -= oldest.text.length + 2;
|
|
418
|
-
samples.pop();
|
|
419
|
-
}
|
|
420
|
-
};
|
|
421
|
-
// Keyed by the transcript's project directory, which is Claude Code's own
|
|
422
|
-
// grouping. The directory name is a lossy encoding of the path, so the real
|
|
423
|
-
// working directory comes from the `cwd` recorded inside the entries.
|
|
424
|
-
const byProjectDir = new Map();
|
|
425
|
-
for (const filePath of files) {
|
|
426
|
-
const projectDir = dirname(filePath);
|
|
427
|
-
let project = byProjectDir.get(projectDir);
|
|
428
|
-
if (!project) {
|
|
429
|
-
project = { cwd: null, promptCount: 0, lastActiveAt: 0 };
|
|
430
|
-
byProjectDir.set(projectDir, project);
|
|
431
|
-
}
|
|
432
|
-
let content;
|
|
433
|
-
try {
|
|
434
|
-
content = await readFile(filePath, 'utf8');
|
|
435
|
-
}
|
|
436
|
-
catch {
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
for (const line of content.split('\n')) {
|
|
440
|
-
if (!line.trim())
|
|
441
|
-
continue;
|
|
442
|
-
let parsed;
|
|
443
|
-
try {
|
|
444
|
-
parsed = JSON.parse(line);
|
|
445
|
-
}
|
|
446
|
-
catch {
|
|
447
|
-
continue;
|
|
448
|
-
}
|
|
449
|
-
const entry = parsed;
|
|
450
|
-
if (!project.cwd && typeof entry.cwd === 'string' && entry.cwd) {
|
|
451
|
-
project.cwd = entry.cwd;
|
|
452
|
-
}
|
|
453
|
-
const text = promptTextFrom(parsed);
|
|
454
|
-
if (text === null)
|
|
455
|
-
continue;
|
|
456
|
-
const words = countWords(text);
|
|
457
|
-
if (words <= 0)
|
|
458
|
-
continue;
|
|
459
|
-
wordCounts.push(words);
|
|
460
|
-
project.promptCount += 1;
|
|
461
|
-
const at = Date.parse(String(entry.timestamp));
|
|
462
|
-
if (Number.isFinite(at) && at > project.lastActiveAt) {
|
|
463
|
-
project.lastActiveAt = at;
|
|
464
|
-
}
|
|
465
|
-
const promptLine = parsePromptLine(line);
|
|
466
|
-
if (promptLine)
|
|
467
|
-
addPromptToActivity(activity, promptLine);
|
|
468
|
-
addSample(text, normalizeTimestamp(entry.timestamp));
|
|
469
|
-
}
|
|
470
|
-
}
|
|
471
|
-
const sources = {
|
|
472
|
-
claude_code: activity,
|
|
473
|
-
};
|
|
474
|
-
for (const source of IDE_PROMPT_SOURCES) {
|
|
475
|
-
const sourceActivity = emptyPromptActivity();
|
|
476
|
-
const prompts = await source.scan();
|
|
477
|
-
// Reverse preserves the newest-first sample order for equal timestamps.
|
|
478
|
-
for (let i = prompts.length - 1; i >= 0; i--) {
|
|
479
|
-
const prompt = prompts[i];
|
|
480
|
-
if (!prompt)
|
|
481
|
-
continue;
|
|
482
|
-
const words = countWords(prompt.text);
|
|
483
|
-
if (words === 0)
|
|
484
|
-
continue;
|
|
485
|
-
wordCounts.push(words);
|
|
486
|
-
if (prompt.timestamp) {
|
|
487
|
-
addPromptToActivity(sourceActivity, {
|
|
488
|
-
sessionId: prompt.sessionId,
|
|
489
|
-
timestamp: prompt.timestamp,
|
|
490
|
-
words,
|
|
491
|
-
});
|
|
492
|
-
}
|
|
493
|
-
addSample(prompt.text, prompt.timestamp);
|
|
494
|
-
}
|
|
495
|
-
sources[source.id] = sourceActivity;
|
|
496
|
-
}
|
|
497
|
-
if (wordCounts.length === 0)
|
|
498
|
-
return null;
|
|
499
|
-
const bucketMax = bucketMaxFor(wordCounts);
|
|
500
|
-
const stats = {
|
|
501
|
-
totalPrompts: wordCounts.length,
|
|
502
|
-
bucketMax,
|
|
503
|
-
histogram: buildHistogram(wordCounts, bucketMax),
|
|
504
|
-
tail: buildTail(wordCounts, bucketMax),
|
|
505
|
-
projects: await resolveProjects(byProjectDir),
|
|
506
|
-
activity: { ...mergePromptActivities(Object.values(sources)), sources },
|
|
507
|
-
};
|
|
508
|
-
if (options.includeSample && samples.length > 0) {
|
|
509
|
-
stats.conversationSample = samples
|
|
510
|
-
.map((sample) => sample.text)
|
|
511
|
-
.join('\n\n')
|
|
512
|
-
.slice(0, CONVERSATION_SAMPLE_MAX_CHARS);
|
|
513
|
-
}
|
|
514
|
-
return stats;
|
|
515
|
-
}
|
|
516
|
-
/**
|
|
517
|
-
* The `promptStats` block as the server takes it. `activity` is deliberately
|
|
518
|
-
* dropped: it is local bookkeeping for the tick's incremental state, and it
|
|
519
|
-
* travels under its own top-level `promptActivity` field instead.
|
|
520
|
-
*/
|
|
521
|
-
export function promptStatsPayload(stats) {
|
|
522
|
-
const { activity: _activity, ...wire } = stats;
|
|
523
|
-
return wire;
|
|
524
|
-
}
|
|
525
|
-
/**
|
|
526
|
-
* Turn the per-directory tallies into repo-keyed entries. Directories with no
|
|
527
|
-
* prompts, no recorded `cwd`, or no git origin drop out — the backend can only
|
|
528
|
-
* match a project by its repo URL, so an entry without one is dead weight.
|
|
529
|
-
*
|
|
530
|
-
* Two transcript directories can resolve to the same repo (the same project
|
|
531
|
-
* opened at different paths), so counts are summed per origin.
|
|
532
|
-
*/
|
|
533
|
-
async function resolveProjects(byProjectDir) {
|
|
534
|
-
const byRepo = new Map();
|
|
535
|
-
for (const project of byProjectDir.values()) {
|
|
536
|
-
if (project.promptCount === 0 || !project.cwd)
|
|
537
|
-
continue;
|
|
538
|
-
const repoUrl = await gitOriginUrl(project.cwd);
|
|
539
|
-
if (!repoUrl)
|
|
540
|
-
continue;
|
|
541
|
-
const existing = byRepo.get(repoUrl);
|
|
542
|
-
if (existing) {
|
|
543
|
-
existing.promptCount += project.promptCount;
|
|
544
|
-
existing.lastActiveAt = Math.max(existing.lastActiveAt, project.lastActiveAt);
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
byRepo.set(repoUrl, {
|
|
548
|
-
promptCount: project.promptCount,
|
|
549
|
-
lastActiveAt: project.lastActiveAt,
|
|
550
|
-
});
|
|
551
|
-
}
|
|
552
|
-
}
|
|
553
|
-
return [...byRepo.entries()].map(([repoUrl, entry]) => ({
|
|
554
|
-
repoUrl,
|
|
555
|
-
promptCount: entry.promptCount,
|
|
556
|
-
// A transcript with no usable timestamp still happened; dating it now is
|
|
557
|
-
// more honest than dropping the project or claiming the epoch.
|
|
558
|
-
lastActiveAt: new Date(entry.lastActiveAt > 0 ? entry.lastActiveAt : Date.now()).toISOString(),
|
|
559
|
-
}));
|
|
560
|
-
}
|
|
561
|
-
//# sourceMappingURL=prompt-stats.js.map
|
package/dist/prompt-stats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,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CACzD,CAAC,WAAW,EAAE;KAChB,CAAC,CAAC,CAAA;AACL,CAAC"}
|
package/dist/referral.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A shareable referral URL for `handle`, hung off the site root so it lands on
|
|
3
|
-
* the install/join page. `base` is a backend origin without a trailing slash
|
|
4
|
-
* (what `resolveAppUrl` returns), e.g. `https://hacklab.so`.
|
|
5
|
-
*/
|
|
6
|
-
export declare function referralUrl(handle: string, base: string): string;
|
|
7
|
-
/**
|
|
8
|
-
* A ready-to-send, one-paragraph blurb a user can drop straight into a DM (or
|
|
9
|
-
* an AI assistant that's helping them recruit) — the "message to send it to
|
|
10
|
-
* your cool smart hacker friends." Ends with the referral link so the whole
|
|
11
|
-
* thing is a single copy-paste.
|
|
12
|
-
*/
|
|
13
|
-
export declare function referralMessage(handle: string, base: string): string;
|
|
14
|
-
//# sourceMappingURL=referral.d.ts.map
|
package/dist/referral.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"referral.d.ts","sourceRoot":"","sources":["../src/referral.ts"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAMpE"}
|
package/dist/referral.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
// The referral link and its share copy live here, in one place, so every
|
|
2
|
-
// surface that shows it (the standalone `hacklab referral` command) builds the
|
|
3
|
-
// exact same URL and message. A referral is just
|
|
4
|
-
// the user's handle carried on a `?ref=` query param onto the marketing site:
|
|
5
|
-
// the root domain always resolves, an unrecognized query param can't 404, and
|
|
6
|
-
// it's the conventional shape for the backend to attribute a signup to whoever
|
|
7
|
-
// sent the link.
|
|
8
|
-
/**
|
|
9
|
-
* A shareable referral URL for `handle`, hung off the site root so it lands on
|
|
10
|
-
* the install/join page. `base` is a backend origin without a trailing slash
|
|
11
|
-
* (what `resolveAppUrl` returns), e.g. `https://hacklab.so`.
|
|
12
|
-
*/
|
|
13
|
-
export function referralUrl(handle, base) {
|
|
14
|
-
const origin = base.replace(/\/$/, '');
|
|
15
|
-
return `${origin}/?ref=${encodeURIComponent(handle)}`;
|
|
16
|
-
}
|
|
17
|
-
/**
|
|
18
|
-
* A ready-to-send, one-paragraph blurb a user can drop straight into a DM (or
|
|
19
|
-
* an AI assistant that's helping them recruit) — the "message to send it to
|
|
20
|
-
* your cool smart hacker friends." Ends with the referral link so the whole
|
|
21
|
-
* thing is a single copy-paste.
|
|
22
|
-
*/
|
|
23
|
-
export function referralMessage(handle, base) {
|
|
24
|
-
return ('join me on hacklab — the terminal-native network for AI-native hackers. ' +
|
|
25
|
-
'scan your AI token usage, see where you rank, and claim your profile:\n' +
|
|
26
|
-
referralUrl(handle, base));
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=referral.js.map
|
package/dist/referral.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"referral.js","sourceRoot":"","sources":["../src/referral.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,+EAA+E;AAC/E,iDAAiD;AACjD,8EAA8E;AAC9E,8EAA8E;AAC9E,+EAA+E;AAC/E,iBAAiB;AAEjB;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,MAAc,EAAE,IAAY;IACtD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACtC,OAAO,GAAG,MAAM,SAAS,kBAAkB,CAAC,MAAM,CAAC,EAAE,CAAA;AACvD,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,MAAc,EAAE,IAAY;IAC1D,OAAO,CACL,0EAA0E;QAC1E,yEAAyE;QACzE,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAC1B,CAAA;AACH,CAAC"}
|
package/dist/registry.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export type CommandSpec = {
|
|
2
|
-
/** The full command name, e.g. `chat`. */
|
|
3
|
-
name: string;
|
|
4
|
-
/** Args shown after the name in help, e.g. `<key> <val>`. Omit if it takes none. */
|
|
5
|
-
args?: string;
|
|
6
|
-
/** One-line description shown in `hacklab --help`. */
|
|
7
|
-
summary: string;
|
|
8
|
-
/** Run the command with the per-command args (the global `--env` is already stripped). */
|
|
9
|
-
run: (args: string[]) => Promise<void> | void;
|
|
10
|
-
};
|
|
11
|
-
export declare const COMMANDS: CommandSpec[];
|
|
12
|
-
/** Every command name, in registry order — the source of truth for resolution. */
|
|
13
|
-
export declare const COMMAND_NAMES: string[];
|
|
14
|
-
export declare function findCommand(name: string): CommandSpec | undefined;
|
|
15
|
-
//# sourceMappingURL=registry.d.ts.map
|
package/dist/registry.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,WAAW,GAAG;IACxB,0CAA0C;IAC1C,IAAI,EAAE,MAAM,CAAA;IACZ,oFAAoF;IACpF,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAA;IACf,0FAA0F;IAC1F,GAAG,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,WAAW,EAuJjC,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,aAAa,UAA8B,CAAA;AAExD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,SAAS,CAEjE"}
|