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/commands/setup.js
DELETED
|
@@ -1,442 +0,0 @@
|
|
|
1
|
-
import * as clack from '@clack/prompts';
|
|
2
|
-
import { findAgentCli, launchAgentCli, notifyAgentHandoff, } from '../agent-handoff.js';
|
|
3
|
-
import { dailySyncState, formatManualSchedule, installDailySync, } from '../daily-sync.js';
|
|
4
|
-
import { captureEvent, identifyUser } from '../posthog.js';
|
|
5
|
-
import { loadPromptSync, savePromptSync, } from '../prompt-consent.js';
|
|
6
|
-
import { stageFullScan } from '../scanners/incremental.js';
|
|
7
|
-
import { collectToolScans, mergeToolScans, } from '../scanners/index.js';
|
|
8
|
-
import { formatTokens } from '../scanners/util.js';
|
|
9
|
-
import { clearSession, loadSession, resolveAppUrl, saveSession, verifySession, } from '../session.js';
|
|
10
|
-
import { scanConsentedPromptStats, uploadTokenScan } from '../sync.js';
|
|
11
|
-
import { bold, dim } from '../ui.js';
|
|
12
|
-
import { waitForBareEnter } from '../utils/waitForEnter.js';
|
|
13
|
-
import { ensureHandleClaimed, performLogin } from './login.js';
|
|
14
|
-
import { PROFILE_SETUP_PROMPT } from './rtfm.js';
|
|
15
|
-
import { TOOL_LABELS } from './scan.js';
|
|
16
|
-
import { canRedraw, railAgentOffer, railDeviceCode } from './setup-rail.js';
|
|
17
|
-
/**
|
|
18
|
-
* `hacklab setup` — the front door.
|
|
19
|
-
*
|
|
20
|
-
* scan → anonymous rank → sign in → one consent question → upload →
|
|
21
|
-
* daemon → hand the profile work to a coding agent
|
|
22
|
-
*
|
|
23
|
-
* The one deliberate composite command in the CLI (DESIGN.md's "one job per
|
|
24
|
-
* command" carries a recorded exception for it): face-to-face testing showed
|
|
25
|
-
* that install → `login` → `scan` reads as three unrelated chores to someone who
|
|
26
|
-
* has never used hacklab, and people stalled between them. Each stage still
|
|
27
|
-
* degrades on its own terms, and every piece remains its own command for anyone
|
|
28
|
-
* who wants to re-run just that piece.
|
|
29
|
-
*
|
|
30
|
-
* It is also the one command allowed clack chrome, and it spends that allowance
|
|
31
|
-
* on being *one* flow: every line goes on the step rail, and every stage ends as
|
|
32
|
-
* a single line naming the stage and how it went. What a stage shows while it is
|
|
33
|
-
* working — the per-tool receipt, the device code — has done its job by the time
|
|
34
|
-
* the next stage starts, so it comes back off the screen. `setup-rail.ts` holds
|
|
35
|
-
* the two blocks clack has no widget for.
|
|
36
|
-
*
|
|
37
|
-
* Being the front door also means it is the one command that never takes the
|
|
38
|
-
* session file's word for it. The installer runs `setup` after every install,
|
|
39
|
-
* including on a machine that already has a session, so this is where "is this
|
|
40
|
-
* account still real" gets asked of the *server* — a token that was revoked or
|
|
41
|
-
* has expired can't be allowed to pass as set up and arm a daemon that uploads
|
|
42
|
-
* into 401s.
|
|
43
|
-
*/
|
|
44
|
-
export async function setup() {
|
|
45
|
-
clack.intro(bold('Hacklab CLI setup'));
|
|
46
|
-
clack.log.message(dim('scans your AI usage, signs you in, and starts a background usage sync'));
|
|
47
|
-
// A session on disk only counts once the server agrees it still works —
|
|
48
|
-
// everything below (the early return included) reads `existing` as proof of
|
|
49
|
-
// an account, so the check has to happen before any of it.
|
|
50
|
-
const saved = await loadSession();
|
|
51
|
-
const existing = saved ? await confirmSession(saved) : null;
|
|
52
|
-
// Resolved after the check: a refused session is gone, and the flow now
|
|
53
|
-
// targets whatever `login` would (HACKLAB_APP_URL / --env, else production).
|
|
54
|
-
const appUrl = resolveAppUrl(existing);
|
|
55
|
-
const syncState = await dailySyncState();
|
|
56
|
-
// ── Already set up ───────────────────────────────────────────────────────
|
|
57
|
-
// A finished account AND a live daemon means there is genuinely nothing to
|
|
58
|
-
// do. Anything less falls through and skips only the stages already done.
|
|
59
|
-
if (existing?.handle && existing.usernameClaimed && syncState === 'current') {
|
|
60
|
-
clack.log.success(`already set up — you're ${bold(`@${existing.handle}`)}`);
|
|
61
|
-
clack.log.message(dim('re-scan with `hacklab scan`, re-upload with `hacklab sync`'), { spacing: 0 });
|
|
62
|
-
clack.outro(dim(`${appUrl}/${existing.handle}`));
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
// ── Scan (before auth — an anonymous scan needs no account) ──────────────
|
|
66
|
-
const scanStep = startScanStep();
|
|
67
|
-
let results;
|
|
68
|
-
try {
|
|
69
|
-
results = await collectToolScans();
|
|
70
|
-
}
|
|
71
|
-
catch (err) {
|
|
72
|
-
scanStep.failed('scan failed');
|
|
73
|
-
clack.cancel(`couldn't read local AI usage: ${err instanceof Error ? err.message : String(err)}`);
|
|
74
|
-
process.exit(1);
|
|
75
|
-
}
|
|
76
|
-
const scan = mergeToolScans(results);
|
|
77
|
-
// The per-tool tally is worth reading while the rank call is in flight and
|
|
78
|
-
// worth nothing after it — `hacklab scan` is where it lives permanently, and
|
|
79
|
-
// the share card carries it onward. So it goes inside the step, and leaves
|
|
80
|
-
// with it.
|
|
81
|
-
for (const line of scanNotes(scan))
|
|
82
|
-
scanStep.note(line);
|
|
83
|
-
// ── Anonymous rank preview (a hook, never a gate) ────────────────────────
|
|
84
|
-
const preview = scan.grandTotal > 0 ? await fetchRankPreview(appUrl, scan.grandTotal) : null;
|
|
85
|
-
scanStep.done(scanSummary(scan));
|
|
86
|
-
if (preview) {
|
|
87
|
-
clack.log.step(`you'd be #${preview.rank} of ${preview.ofTotal.toLocaleString('en-US')} hackers`);
|
|
88
|
-
}
|
|
89
|
-
if (scan.grandTotal === 0) {
|
|
90
|
-
// No hard floor: a hackathon-door signup on a fresh laptop is exactly who
|
|
91
|
-
// this flow is for, so the default is yes. The step above already said
|
|
92
|
-
// there is nothing here, so the question only has to be the question.
|
|
93
|
-
const cont = await clack.confirm({
|
|
94
|
-
message: 'set up your account anyway?',
|
|
95
|
-
initialValue: true,
|
|
96
|
-
});
|
|
97
|
-
if (clack.isCancel(cont) || !cont) {
|
|
98
|
-
clack.outro(dim('come back after some Claude Code / Codex / Cursor sessions.'));
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
// ── Sign in (the exact device flow `hacklab login` runs) ─────────────────
|
|
103
|
-
let session;
|
|
104
|
-
let claimFailed;
|
|
105
|
-
if (existing) {
|
|
106
|
-
// Reuse a session that's already on disk. It may still be half-finished
|
|
107
|
-
// (auth succeeded, the claim didn't), so run the claim guard over it.
|
|
108
|
-
const outcome = await ensureHandleClaimed(existing, 2, 'setup');
|
|
109
|
-
if (outcome.session !== existing)
|
|
110
|
-
await saveSession(outcome.session);
|
|
111
|
-
session = outcome.session;
|
|
112
|
-
claimFailed = outcome.claimFailed;
|
|
113
|
-
}
|
|
114
|
-
else {
|
|
115
|
-
try {
|
|
116
|
-
const outcome = await performLogin({
|
|
117
|
-
claimAttempts: 2,
|
|
118
|
-
// Both of setup's auth paths claim as `setup`, so the web can point the
|
|
119
|
-
// hacker back at the terminal they are standing in.
|
|
120
|
-
flow: 'setup',
|
|
121
|
-
// The rail block ends by redrawing itself away; with no terminal to
|
|
122
|
-
// redraw, `login`'s plain block is the honest thing to print.
|
|
123
|
-
...(canRedraw() ? { deviceCode: railDeviceCode() } : {}),
|
|
124
|
-
});
|
|
125
|
-
session = outcome.session;
|
|
126
|
-
claimFailed = outcome.claimFailed;
|
|
127
|
-
}
|
|
128
|
-
catch (err) {
|
|
129
|
-
clack.cancel(`sign-in failed: ${err instanceof Error ? err.message : String(err)}. run \`hacklab setup\` again.`);
|
|
130
|
-
process.exit(1);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
clack.log.step(session.handle
|
|
134
|
-
? `hacklab · signed in as @${session.handle}`
|
|
135
|
-
: `hacklab · signed in as ${session.email}`);
|
|
136
|
-
// A lost claim must never be silent here: the web onboarding page polls
|
|
137
|
-
// `username_claimed` and would sit spinning forever.
|
|
138
|
-
if (claimFailed) {
|
|
139
|
-
clack.log.error("couldn't finish claiming your handle");
|
|
140
|
-
clack.log.message(dim('run `hacklab login` again to finish it'), {
|
|
141
|
-
spacing: 0,
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
// ── The one question in the flow ─────────────────────────────────────────
|
|
145
|
-
const consent = await askPromptSyncConsent();
|
|
146
|
-
// ── Upload ───────────────────────────────────────────────────────────────
|
|
147
|
-
const spin = clack.spinner();
|
|
148
|
-
spin.start('saving your usage');
|
|
149
|
-
let rank;
|
|
150
|
-
try {
|
|
151
|
-
const promptStats = await scanConsentedPromptStats(consent);
|
|
152
|
-
// Re-base the minutely tick's incremental state on this scan — otherwise
|
|
153
|
-
// the first tick re-uploads the whole history. Staged before the upload so
|
|
154
|
-
// the prompt activity it works out rides along, exactly as `sync` does.
|
|
155
|
-
const staged = await stageFullScan(results, {
|
|
156
|
-
scanned: promptStats?.activity ?? null,
|
|
157
|
-
});
|
|
158
|
-
const uploaded = await uploadTokenScan(session, staged.promptActivity
|
|
159
|
-
? { ...scan, promptActivity: staged.promptActivity }
|
|
160
|
-
: scan, { interactive: true, timeoutMs: 120_000, promptStats });
|
|
161
|
-
await staged.commit();
|
|
162
|
-
const after = uploaded.rankAfter;
|
|
163
|
-
if (typeof after === 'number' && Number.isFinite(after))
|
|
164
|
-
rank = after;
|
|
165
|
-
spin.stop(rank ? `synced · rank #${rank}` : 'synced');
|
|
166
|
-
}
|
|
167
|
-
catch {
|
|
168
|
-
// Never fatal — the account exists, and `hacklab sync` is the recovery.
|
|
169
|
-
spin.stop('usage sync deferred');
|
|
170
|
-
clack.log.message(dim('run `hacklab sync` later to upload it'), {
|
|
171
|
-
spacing: 0,
|
|
172
|
-
});
|
|
173
|
-
}
|
|
174
|
-
// ── Daemon (silent; the intro line is the whole disclosure) ──────────────
|
|
175
|
-
await installDaemon(syncState, session.handle);
|
|
176
|
-
// ── Tail ─────────────────────────────────────────────────────────────────
|
|
177
|
-
clack.log.success(session.handle ? `you're in — ${appUrl}/${session.handle}` : "you're in");
|
|
178
|
-
const handoff = await offerAgentHandoff(session, appUrl);
|
|
179
|
-
if (session.handle) {
|
|
180
|
-
await identifyUser(session.handle, {
|
|
181
|
-
$set: {
|
|
182
|
-
email: session.email,
|
|
183
|
-
handle: session.handle,
|
|
184
|
-
app_url: appUrl,
|
|
185
|
-
},
|
|
186
|
-
$set_once: { joined_at: new Date().toISOString() },
|
|
187
|
-
});
|
|
188
|
-
const reportedRank = rank ?? preview?.rank;
|
|
189
|
-
await captureEvent(session.handle, 'cli_setup_completed', {
|
|
190
|
-
tokens_total: scan.grandTotal,
|
|
191
|
-
...(reportedRank ? { rank: reportedRank } : {}),
|
|
192
|
-
prompt_sync: consent,
|
|
193
|
-
});
|
|
194
|
-
await captureEvent(session.handle, 'cli_agent_handoff', {
|
|
195
|
-
...(handoff.agent ? { agent: handoff.agent } : {}),
|
|
196
|
-
outcome: handoff.outcome,
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* The session to keep going with, after asking the server about it.
|
|
202
|
-
*
|
|
203
|
-
* Three answers, three outcomes. A refusal (401) is the only one that costs the
|
|
204
|
-
* user their session: the token is dead, so the file goes, one line says why,
|
|
205
|
-
* and the flow carries on from the top as if the machine had never been signed
|
|
206
|
-
* in — straight into the device flow. An unreachable or unhappy server is not a
|
|
207
|
-
* verdict, so the local session stands and the flow runs exactly as it did
|
|
208
|
-
* before this check existed; a first run on a plane still works. A confirmed
|
|
209
|
-
* session says nothing at all.
|
|
210
|
-
*/
|
|
211
|
-
async function confirmSession(session) {
|
|
212
|
-
const check = await verifySession(session);
|
|
213
|
-
if (check === 'unauthorized') {
|
|
214
|
-
await clearSession();
|
|
215
|
-
clack.log.warn('your session has expired — signing in again');
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
if (check === 'unverified') {
|
|
219
|
-
clack.log.message(dim(`couldn't reach ${resolveAppUrl(session)} to check your session — continuing offline`), { spacing: 0 });
|
|
220
|
-
}
|
|
221
|
-
return session;
|
|
222
|
-
}
|
|
223
|
-
/**
|
|
224
|
-
* What the scan step shows while it is still running: one line per tool it
|
|
225
|
-
* found, biggest first.
|
|
226
|
-
*
|
|
227
|
-
* Deliberately not `scan`'s full receipt. That breaks every tool down by model,
|
|
228
|
-
* which on a heavy machine is twenty-odd lines — a wall to put up and take down
|
|
229
|
-
* again for the few seconds the rank call is in flight. One line per tool is the
|
|
230
|
-
* same answer at the altitude a first run needs, and it stays short.
|
|
231
|
-
*/
|
|
232
|
-
function scanNotes(scan) {
|
|
233
|
-
return Object.entries(scan.toolTotals)
|
|
234
|
-
.filter(([, total]) => total > 0)
|
|
235
|
-
.sort((a, b) => b[1] - a[1])
|
|
236
|
-
.map(([tool, total]) => `${TOOL_LABELS[tool] ?? tool} · ${formatTokens(total)} tokens`);
|
|
237
|
-
}
|
|
238
|
-
/** The one line the scan stage leaves on the rail. */
|
|
239
|
-
function scanSummary(scan) {
|
|
240
|
-
return scan.grandTotal > 0
|
|
241
|
-
? `scanned · ${formatTokens(scan.grandTotal)} tokens`
|
|
242
|
-
: 'scanned · no recorded token usage on this machine';
|
|
243
|
-
}
|
|
244
|
-
/**
|
|
245
|
-
* The scan stage as a step that shows its working and then compresses.
|
|
246
|
-
*
|
|
247
|
-
* clack's `taskLog` is exactly this shape — notes on the rail while the step
|
|
248
|
-
* runs, one line where they were once it finishes — but it collapses by walking
|
|
249
|
-
* the cursor back, which is litter down a pipe and a divide by zero on a
|
|
250
|
-
* terminal that reports no width. A plain spinner is the honest stand-in there:
|
|
251
|
-
* same single closing line, no notes.
|
|
252
|
-
*/
|
|
253
|
-
function startScanStep() {
|
|
254
|
-
const title = 'scanning local AI tool usage';
|
|
255
|
-
if (!canRedraw()) {
|
|
256
|
-
const spin = clack.spinner();
|
|
257
|
-
spin.start(title);
|
|
258
|
-
return {
|
|
259
|
-
note: () => {
|
|
260
|
-
// A spinner has nowhere to put notes it could take back.
|
|
261
|
-
},
|
|
262
|
-
done: (summary) => spin.stop(summary),
|
|
263
|
-
failed: (summary) => spin.stop(summary),
|
|
264
|
-
};
|
|
265
|
-
}
|
|
266
|
-
const log = clack.taskLog({ title });
|
|
267
|
-
return {
|
|
268
|
-
// taskLog dims its own notes and sizes them by raw string length, so they
|
|
269
|
-
// arrive as plain text: colouring them would both fight the dim and throw
|
|
270
|
-
// its row arithmetic off by the length of every escape sequence.
|
|
271
|
-
note: (line) => log.message(line),
|
|
272
|
-
done: (summary) => log.success(summary),
|
|
273
|
-
failed: (summary) => log.error(summary, { showLog: false }),
|
|
274
|
-
};
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* The last beat of setup: offer to hand the profile work to a coding agent the
|
|
278
|
-
* user already has installed, and close the flow.
|
|
279
|
-
*
|
|
280
|
-
* Every path ends with one closing line, and the browser line is printed before
|
|
281
|
-
* the agent takes over the terminal — once it does, nothing we print afterwards
|
|
282
|
-
* would be read in time. Every path also tells the backend what happened: the
|
|
283
|
-
* web onboarding only waits on a `launched`, and switches to the manual
|
|
284
|
-
* paste-the-prompt step on `declined` / `unavailable` or on hearing nothing.
|
|
285
|
-
*/
|
|
286
|
-
async function offerAgentHandoff(session, appUrl) {
|
|
287
|
-
const browserLine = 'head back to your browser — the page will move on by itself';
|
|
288
|
-
const agent = process.stdin.isTTY ? findAgentCli() : null;
|
|
289
|
-
if (!agent) {
|
|
290
|
-
await notifyAgentHandoff(appUrl, session.token, 'unavailable');
|
|
291
|
-
if (process.stdin.isTTY)
|
|
292
|
-
printManualPrompt();
|
|
293
|
-
clack.outro(dim(browserLine));
|
|
294
|
-
return { outcome: 'unavailable' };
|
|
295
|
-
}
|
|
296
|
-
const offer = railAgentOffer(agent.name);
|
|
297
|
-
const accepted = await waitForBareEnter(offer.prompt);
|
|
298
|
-
offer.settle();
|
|
299
|
-
if (!accepted) {
|
|
300
|
-
clack.log.step('skipped');
|
|
301
|
-
await notifyAgentHandoff(appUrl, session.token, 'declined');
|
|
302
|
-
printManualPrompt();
|
|
303
|
-
clack.outro(dim(browserLine));
|
|
304
|
-
return { outcome: 'declined', agent: agent.bin };
|
|
305
|
-
}
|
|
306
|
-
clack.log.step(`handed off to ${agent.name}`);
|
|
307
|
-
clack.log.message(dim(browserLine));
|
|
308
|
-
// Ordering is load-bearing: the `launched` signal must be *awaited* before
|
|
309
|
-
// the spawn. `launchAgentCli` uses `spawnSync`, which blocks the event loop
|
|
310
|
-
// for the whole agent session, so a fire-and-forget fetch would not actually
|
|
311
|
-
// go out until the agent exits — by which time the web page it was meant to
|
|
312
|
-
// steer has long since given up. The 8s timeout inside `notifyAgentHandoff`
|
|
313
|
-
// caps how long this can hold up the spawn; the typical case is one fast POST.
|
|
314
|
-
await notifyAgentHandoff(appUrl, session.token, 'launched', agent.bin);
|
|
315
|
-
if (!launchAgentCli(agent, PROFILE_SETUP_PROMPT)) {
|
|
316
|
-
// The correction to the `launched` we just sent: the process never
|
|
317
|
-
// started, so the page must stop waiting and show the manual prompt.
|
|
318
|
-
await notifyAgentHandoff(appUrl, session.token, 'unavailable', agent.bin);
|
|
319
|
-
clack.log.error(`couldn't start ${agent.name}`);
|
|
320
|
-
printManualPrompt();
|
|
321
|
-
clack.outro(dim(session.handle ? `${appUrl}/${session.handle}` : appUrl));
|
|
322
|
-
return { outcome: 'spawn_failed', agent: agent.bin };
|
|
323
|
-
}
|
|
324
|
-
clack.outro(dim(session.handle
|
|
325
|
-
? `${agent.name} finished — ${appUrl}/${session.handle}`
|
|
326
|
-
: `${agent.name} finished`));
|
|
327
|
-
return { outcome: 'launched', agent: agent.bin };
|
|
328
|
-
}
|
|
329
|
-
/** The fallback when no agent runs here: the same line the web page shows. */
|
|
330
|
-
function printManualPrompt() {
|
|
331
|
-
clack.log.message([
|
|
332
|
-
dim("paste this into your agent when you're ready:"),
|
|
333
|
-
bold(PROFILE_SETUP_PROMPT),
|
|
334
|
-
]);
|
|
335
|
-
}
|
|
336
|
-
/**
|
|
337
|
-
* Ask once whether to sync prompt activity, defaulting to yes.
|
|
338
|
-
*
|
|
339
|
-
* Deliberately NOT prompt-consent.ts's `askYesNo` (which refuses to carry a
|
|
340
|
-
* default): setup is the one place a default-yes is the product decision, and
|
|
341
|
-
* `clack.confirm` with `initialValue: true` still requires the user to accept it
|
|
342
|
-
* — a keypress they perform, not a value applied behind their back. `sync`'s
|
|
343
|
-
* no-default disclosure is untouched. A non-TTY run has nobody to accept, so it
|
|
344
|
-
* stays at 'none'.
|
|
345
|
-
*
|
|
346
|
-
* One question, so it can only honestly offer one tier: `stats`, the metadata
|
|
347
|
-
* one, which is the most a default-yes should carry. Sending prompt *text* is
|
|
348
|
-
* the `full` tier and stays a deliberate second act — named here, chosen
|
|
349
|
-
* elsewhere.
|
|
350
|
-
*/
|
|
351
|
-
async function askPromptSyncConsent() {
|
|
352
|
-
const stored = await loadPromptSync();
|
|
353
|
-
if (stored) {
|
|
354
|
-
// Already answered, so it is not a step to walk — one dim line saying what
|
|
355
|
-
// the answer is and where to change it.
|
|
356
|
-
clack.log.message(dim(`prompt sync · ${stored} — change with \`hacklab config prompt-sync <none|stats|full>\``));
|
|
357
|
-
return stored;
|
|
358
|
-
}
|
|
359
|
-
if (!process.stdin.isTTY)
|
|
360
|
-
return 'none';
|
|
361
|
-
clack.log.message([
|
|
362
|
-
bold('sync your prompt activity?'),
|
|
363
|
-
'hacklab scores how well you work with AI. syncing how you prompt — how',
|
|
364
|
-
'many prompts, how long they are, when each session ran — puts your',
|
|
365
|
-
'sessions and prompt counts on your profile and keeps them current.',
|
|
366
|
-
'sources: Claude Code, GitHub Copilot (VS Code/CLI), and readable',
|
|
367
|
-
'legacy Antigravity IDE logs. unavailable token counts are not estimated.',
|
|
368
|
-
'the text of your prompts stays on this machine.',
|
|
369
|
-
dim('want a sample of your prompts scored too? hacklab config prompt-sync full'),
|
|
370
|
-
dim('change anytime: hacklab config prompt-sync <none|stats|full>'),
|
|
371
|
-
]);
|
|
372
|
-
const answer = await clack.confirm({
|
|
373
|
-
message: 'sync your prompt activity?',
|
|
374
|
-
initialValue: true,
|
|
375
|
-
});
|
|
376
|
-
const tier = !clack.isCancel(answer) && answer === true ? 'stats' : 'none';
|
|
377
|
-
await savePromptSync(tier);
|
|
378
|
-
return tier;
|
|
379
|
-
}
|
|
380
|
-
/** The anonymous "you'd be #N of M" call. Any failure is skipped in silence. */
|
|
381
|
-
async function fetchRankPreview(appUrl, totalTokens) {
|
|
382
|
-
try {
|
|
383
|
-
const res = await fetch(`${appUrl}/api/rank/preview`, {
|
|
384
|
-
method: 'POST',
|
|
385
|
-
headers: { 'Content-Type': 'application/json' },
|
|
386
|
-
body: JSON.stringify({ totalTokens }),
|
|
387
|
-
signal: AbortSignal.timeout(10_000),
|
|
388
|
-
});
|
|
389
|
-
if (!res.ok)
|
|
390
|
-
return null;
|
|
391
|
-
const data = (await res.json());
|
|
392
|
-
if (typeof data.rank !== 'number' || typeof data.ofTotal !== 'number') {
|
|
393
|
-
return null;
|
|
394
|
-
}
|
|
395
|
-
return { rank: data.rank, ofTotal: data.ofTotal };
|
|
396
|
-
}
|
|
397
|
-
catch {
|
|
398
|
-
return null;
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Arm the background sync without asking — the intro line already disclosed it.
|
|
403
|
-
* Same install-once / repair-'stale' rules `scan` uses: a reinstall rewrites the
|
|
404
|
-
* plists/units and bounces the jobs, so only touch the scheduler when something
|
|
405
|
-
* is actually wrong, and only announce a genuinely fresh install.
|
|
406
|
-
*/
|
|
407
|
-
async function installDaemon(state, handle) {
|
|
408
|
-
if (state === 'current')
|
|
409
|
-
return;
|
|
410
|
-
const result = await installDailySync();
|
|
411
|
-
if (!result.ok) {
|
|
412
|
-
// A failed *repair* means the jobs are still scheduled — printing cron
|
|
413
|
-
// instructions there talks the user into a second, duplicate schedule.
|
|
414
|
-
if (state === 'missing') {
|
|
415
|
-
clack.log.warn('background sync · schedule it yourself');
|
|
416
|
-
clack.log.message(formatManualSchedule(result.instructions), {
|
|
417
|
-
spacing: 0,
|
|
418
|
-
});
|
|
419
|
-
if (handle) {
|
|
420
|
-
await captureEvent(handle, 'cli_daily_sync_manual', {
|
|
421
|
-
mechanism: result.mechanism,
|
|
422
|
-
source: 'setup',
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return;
|
|
427
|
-
}
|
|
428
|
-
if (!result.recorded) {
|
|
429
|
-
clack.log.warn('background sync · not recorded, config unwritable');
|
|
430
|
-
return;
|
|
431
|
-
}
|
|
432
|
-
if (state === 'missing') {
|
|
433
|
-
clack.log.step(`background sync · scheduled (${result.mechanism})`);
|
|
434
|
-
if (handle) {
|
|
435
|
-
await captureEvent(handle, 'cli_daily_sync_installed', {
|
|
436
|
-
mechanism: result.mechanism,
|
|
437
|
-
source: 'setup',
|
|
438
|
-
});
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
}
|
|
442
|
-
//# sourceMappingURL=setup.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,gBAAgB,CAAA;AAEvC,OAAO,EACL,YAAY,EACZ,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAA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BACrD,SAAS,EAAE,MAAM,CAAC,SAAS;gBAC3B,MAAM,EAAE,OAAO;aAChB,CAAC,CAAA;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/commands/sync.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* `hacklab sync` — dispatch on flags:
|
|
3
|
-
* (none) interactive sync (scan, upload, show stats)
|
|
4
|
-
* --install-daily deprecated alias for `hacklab daemon`
|
|
5
|
-
* --tick the every-minute incremental run (usually a no-op)
|
|
6
|
-
* --quiet the unattended daily run (logs to a file, no output)
|
|
7
|
-
*/
|
|
8
|
-
export declare function sync(args?: string[]): Promise<void>;
|
|
9
|
-
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../src/commands/sync.ts"],"names":[],"mappings":"AAgDA;;;;;;GAMG;AACH,wBAAsB,IAAI,CAAC,IAAI,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB7D"}
|