fixmind 1.0.4 → 1.0.6
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 +1 -2
- package/dist/dashboard/assets/index-7eTtNl0A.js +14 -0
- package/dist/dashboard/assets/{index-WDmgeIrO.css → index-CePE7dnd.css} +57 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/src/cli-sync.d.ts +4 -0
- package/dist/src/cli-sync.js +196 -0
- package/dist/src/cli-sync.js.map +1 -0
- package/dist/src/cli-utils.d.ts +34 -0
- package/dist/src/cli-utils.js +119 -0
- package/dist/src/cli-utils.js.map +1 -0
- package/dist/src/cli.js +22 -229
- package/dist/src/cli.js.map +1 -1
- package/dist/src/dashboard.js +16 -0
- package/dist/src/dashboard.js.map +1 -1
- package/dist/src/sync-backend.d.ts +44 -0
- package/dist/src/sync-backend.js +279 -0
- package/dist/src/sync-backend.js.map +1 -0
- package/dist/src/sync.d.ts +2 -44
- package/dist/src/sync.js +36 -289
- package/dist/src/sync.js.map +1 -1
- package/package.json +1 -1
- package/dist/dashboard/assets/index-Bl0HIoQR.js +0 -14
|
@@ -78,12 +78,14 @@
|
|
|
78
78
|
--radius-2xl: 1rem;
|
|
79
79
|
--radius-3xl: 1.5rem;
|
|
80
80
|
--ease-out: cubic-bezier(0, 0, .2, 1);
|
|
81
|
+
--animate-spin: spin 1s linear infinite;
|
|
81
82
|
--default-transition-duration: .15s;
|
|
82
83
|
--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);
|
|
83
84
|
--default-font-family: var(--font-sans);
|
|
84
85
|
--default-mono-font-family: var(--font-mono);
|
|
85
86
|
--color-page: #08090d;
|
|
86
87
|
--color-surface: #11141b;
|
|
88
|
+
--color-surface-2: #161a23;
|
|
87
89
|
--color-line: #232838;
|
|
88
90
|
--color-ink: #e9ecf4;
|
|
89
91
|
--color-muted: #828a9c;
|
|
@@ -757,6 +759,10 @@
|
|
|
757
759
|
rotate: 180deg;
|
|
758
760
|
}
|
|
759
761
|
|
|
762
|
+
.animate-spin {
|
|
763
|
+
animation: var(--animate-spin);
|
|
764
|
+
}
|
|
765
|
+
|
|
760
766
|
.cursor-pointer {
|
|
761
767
|
cursor: pointer;
|
|
762
768
|
}
|
|
@@ -1032,6 +1038,10 @@
|
|
|
1032
1038
|
background-color: var(--color-surface);
|
|
1033
1039
|
}
|
|
1034
1040
|
|
|
1041
|
+
.bg-surface-2 {
|
|
1042
|
+
background-color: var(--color-surface-2);
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1035
1045
|
.bg-transparent {
|
|
1036
1046
|
background-color: #0000;
|
|
1037
1047
|
}
|
|
@@ -1090,6 +1100,10 @@
|
|
|
1090
1100
|
padding-block: calc(var(--spacing) * .5);
|
|
1091
1101
|
}
|
|
1092
1102
|
|
|
1103
|
+
.py-1\.5 {
|
|
1104
|
+
padding-block: calc(var(--spacing) * 1.5);
|
|
1105
|
+
}
|
|
1106
|
+
|
|
1093
1107
|
.py-2 {
|
|
1094
1108
|
padding-block: calc(var(--spacing) * 2);
|
|
1095
1109
|
}
|
|
@@ -1170,6 +1184,10 @@
|
|
|
1170
1184
|
text-align: center;
|
|
1171
1185
|
}
|
|
1172
1186
|
|
|
1187
|
+
.text-right {
|
|
1188
|
+
text-align: right;
|
|
1189
|
+
}
|
|
1190
|
+
|
|
1173
1191
|
.font-mono {
|
|
1174
1192
|
font-family: var(--font-mono);
|
|
1175
1193
|
}
|
|
@@ -1288,11 +1306,20 @@
|
|
|
1288
1306
|
letter-spacing: .15em;
|
|
1289
1307
|
}
|
|
1290
1308
|
|
|
1309
|
+
.tracking-\[\.18em\] {
|
|
1310
|
+
--tw-tracking: .18em;
|
|
1311
|
+
letter-spacing: .18em;
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1291
1314
|
.tracking-tight {
|
|
1292
1315
|
--tw-tracking: var(--tracking-tight);
|
|
1293
1316
|
letter-spacing: var(--tracking-tight);
|
|
1294
1317
|
}
|
|
1295
1318
|
|
|
1319
|
+
.whitespace-nowrap {
|
|
1320
|
+
white-space: nowrap;
|
|
1321
|
+
}
|
|
1322
|
+
|
|
1296
1323
|
.whitespace-pre-wrap {
|
|
1297
1324
|
white-space: pre-wrap;
|
|
1298
1325
|
}
|
|
@@ -1406,6 +1433,12 @@
|
|
|
1406
1433
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
1407
1434
|
}
|
|
1408
1435
|
|
|
1436
|
+
.transition-colors {
|
|
1437
|
+
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
|
|
1438
|
+
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
1439
|
+
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
1440
|
+
}
|
|
1441
|
+
|
|
1409
1442
|
.transition-transform {
|
|
1410
1443
|
transition-property: transform, translate, scale, rotate;
|
|
1411
1444
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
@@ -1459,6 +1492,16 @@
|
|
|
1459
1492
|
border-color: var(--color-accent);
|
|
1460
1493
|
}
|
|
1461
1494
|
|
|
1495
|
+
.hover\:border-accent\/40:hover {
|
|
1496
|
+
border-color: #7c5cff66;
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1499
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1500
|
+
.hover\:border-accent\/40:hover {
|
|
1501
|
+
border-color: color-mix(in oklab, var(--color-accent) 40%, transparent);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1462
1505
|
.hover\:text-accent:hover {
|
|
1463
1506
|
color: var(--color-accent);
|
|
1464
1507
|
}
|
|
@@ -1484,10 +1527,18 @@
|
|
|
1484
1527
|
cursor: default;
|
|
1485
1528
|
}
|
|
1486
1529
|
|
|
1530
|
+
.disabled\:cursor-not-allowed:disabled {
|
|
1531
|
+
cursor: not-allowed;
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1487
1534
|
.disabled\:opacity-30:disabled {
|
|
1488
1535
|
opacity: .3;
|
|
1489
1536
|
}
|
|
1490
1537
|
|
|
1538
|
+
.disabled\:opacity-50:disabled {
|
|
1539
|
+
opacity: .5;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1491
1542
|
@media (hover: hover) {
|
|
1492
1543
|
.disabled\:hover\:text-muted:disabled:hover {
|
|
1493
1544
|
color: var(--color-muted);
|
|
@@ -1801,3 +1852,9 @@
|
|
|
1801
1852
|
syntax: "*";
|
|
1802
1853
|
inherits: false
|
|
1803
1854
|
}
|
|
1855
|
+
|
|
1856
|
+
@keyframes spin {
|
|
1857
|
+
to {
|
|
1858
|
+
transform: rotate(360deg);
|
|
1859
|
+
}
|
|
1860
|
+
}
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
<title>Fixmind</title>
|
|
8
8
|
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
9
9
|
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap">
|
|
10
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
10
|
+
<script type="module" crossorigin src="/assets/index-7eTtNl0A.js"></script>
|
|
11
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CePE7dnd.css">
|
|
12
12
|
</head>
|
|
13
13
|
<body>
|
|
14
14
|
<div id="root"></div>
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function setup(options: Record<string, string | boolean>): Promise<void>;
|
|
2
|
+
export declare function loginCommand(options: Record<string, string | boolean>): Promise<void>;
|
|
3
|
+
export declare function logoutCommand(): Promise<void>;
|
|
4
|
+
export declare function syncCommand(sub: string | undefined): Promise<void>;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { stdin, stdout } from "node:process";
|
|
2
|
+
import { log, outro, password } from "@clack/prompts";
|
|
3
|
+
import { createLessonStore, initializeDataDirectory } from "./storage.js";
|
|
4
|
+
import { createSyncEngine, PRICING_URL } from "./sync.js";
|
|
5
|
+
import { common, isAddressInUseError, intro, multiselect, note, optionalPort, optionString, parseList, select, startSpinner, supportedClientOptions, terminalLink, unwrap, validateClients, validateScope, text, } from "./cli-utils.js";
|
|
6
|
+
import { configureClients, configureInstructions, configurePermissions, detectClients, genericMcpConfiguration } from "./setup.js";
|
|
7
|
+
const DEFAULT_SUPABASE_URL = "https://jpczzgekindvuivnwjuw.supabase.co";
|
|
8
|
+
const DEFAULT_SUPABASE_ANON_KEY = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6ImpwY3p6Z2VraW5kdnVpdm53anV3Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3ODIwNzEyMjEsImV4cCI6MjA5NzY0NzIyMX0.qG-9H5BZi3sKHVQrzL3iI9ALmJgoTizLCU4Bxzpw0Bo";
|
|
9
|
+
export async function setup(options) {
|
|
10
|
+
const paths = initializeDataDirectory();
|
|
11
|
+
const detected = detectClients();
|
|
12
|
+
const supplied = parseList(optionString(options.client));
|
|
13
|
+
let clients = supplied.length ? validateClients(supplied) : detected;
|
|
14
|
+
const suppliedScope = optionString(options.scope);
|
|
15
|
+
let scope = suppliedScope ? validateScope(suppliedScope) : "user";
|
|
16
|
+
const projectDirectory = process.cwd();
|
|
17
|
+
const interactive = stdin.isTTY && stdout.isTTY;
|
|
18
|
+
if (!supplied.length && interactive) {
|
|
19
|
+
intro("Configure Learning Lessons", common);
|
|
20
|
+
note("Pick the AI clients that should receive the MCP server configuration.", "Setup", common);
|
|
21
|
+
const selected = unwrap(await multiselect({
|
|
22
|
+
message: "Clients to configure",
|
|
23
|
+
options: supportedClientOptions(detected),
|
|
24
|
+
initialValues: detected,
|
|
25
|
+
required: false,
|
|
26
|
+
...common,
|
|
27
|
+
}));
|
|
28
|
+
clients = validateClients(selected);
|
|
29
|
+
}
|
|
30
|
+
if (!suppliedScope && interactive) {
|
|
31
|
+
const selectedScope = unwrap(await select({
|
|
32
|
+
message: "Where should fixmind be configured?",
|
|
33
|
+
options: [
|
|
34
|
+
{ value: "user", label: "This device", hint: "Available in every project (~/.claude, ~/.cursor, ...)" },
|
|
35
|
+
{ value: "project", label: "This project only", hint: `Stored inside ${projectDirectory}` },
|
|
36
|
+
],
|
|
37
|
+
initialValue: "user",
|
|
38
|
+
...common,
|
|
39
|
+
}));
|
|
40
|
+
scope = selectedScope;
|
|
41
|
+
}
|
|
42
|
+
if (clients.length === 0) {
|
|
43
|
+
console.log("No supported clients detected. Add this configuration to any stdio MCP client:");
|
|
44
|
+
console.log(JSON.stringify(genericMcpConfiguration(), null, 2));
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
const dryRun = Boolean(options["dry-run"]);
|
|
48
|
+
const setupOptions = { clients, scope, projectDirectory, dryRun };
|
|
49
|
+
const results = configureClients(setupOptions);
|
|
50
|
+
const instructions = configureInstructions(setupOptions);
|
|
51
|
+
const permissions = configurePermissions(setupOptions);
|
|
52
|
+
console.log(`Local data initialized at ${paths.directory}.`);
|
|
53
|
+
console.log(scope === "project" ? `Scope: this project only (${projectDirectory}).` : "Scope: this device (every project).");
|
|
54
|
+
for (const result of results)
|
|
55
|
+
console.log(`${result.client}: ${result.status} - ${result.detail}`);
|
|
56
|
+
for (const result of instructions)
|
|
57
|
+
console.log(`${result.client} instructions: ${result.status} - ${result.filePath}`);
|
|
58
|
+
for (const result of permissions)
|
|
59
|
+
console.log(`${result.client} permissions: ${result.status} - ${result.filePath}`);
|
|
60
|
+
console.log("Restart configured AI clients so they discover the MCP server.");
|
|
61
|
+
if (!dryRun && !options["no-dashboard"]) {
|
|
62
|
+
const { startDashboard } = await import("./dashboard.js");
|
|
63
|
+
try {
|
|
64
|
+
const handle = await startDashboard({ port: optionalPort(options.port), open: true });
|
|
65
|
+
console.log(`Fixmind dashboard: ${handle.url}`);
|
|
66
|
+
console.log("Press Ctrl+C to stop.");
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
if (isAddressInUseError(error)) {
|
|
70
|
+
const port = optionalPort(options.port) ?? 4317;
|
|
71
|
+
console.log(`Dashboard is already running on 127.0.0.1:${port}; skipping a second launch.`);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
throw error;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
export async function loginCommand(options) {
|
|
80
|
+
initializeDataDirectory();
|
|
81
|
+
const store = createLessonStore();
|
|
82
|
+
const interactive = stdin.isTTY && stdout.isTTY;
|
|
83
|
+
try {
|
|
84
|
+
const engine = createSyncEngine(store);
|
|
85
|
+
const supabaseUrl = optionString(options.url) ?? process.env.FIXMIND_SUPABASE_URL ?? DEFAULT_SUPABASE_URL;
|
|
86
|
+
const supabaseAnonKey = optionString(options.key) ?? process.env.FIXMIND_SUPABASE_ANON_KEY ?? DEFAULT_SUPABASE_ANON_KEY;
|
|
87
|
+
if (interactive)
|
|
88
|
+
intro("Fixmind login", common);
|
|
89
|
+
const passphrase = optionString(options.passphrase) ?? (interactive
|
|
90
|
+
? unwrap(await password({ message: "Sync encryption passphrase (use the same one on every machine)", ...common }))
|
|
91
|
+
: (() => { throw new Error("--passphrase is required outside an interactive terminal."); })());
|
|
92
|
+
const usePasswordLogin = Boolean(optionString(options.email) || options["password-login"]);
|
|
93
|
+
let result;
|
|
94
|
+
if (usePasswordLogin) {
|
|
95
|
+
const email = optionString(options.email) ?? (interactive
|
|
96
|
+
? unwrap(await text({ message: "Email", ...common }))
|
|
97
|
+
: (() => { throw new Error("Usage: fixmind login --email <email> --password <password> --passphrase <passphrase>"); })());
|
|
98
|
+
const userPassword = optionString(options.password) ?? (interactive
|
|
99
|
+
? unwrap(await password({ message: "Password", ...common }))
|
|
100
|
+
: (() => { throw new Error("--password is required outside an interactive terminal."); })());
|
|
101
|
+
result = await engine.login({ supabaseUrl, supabaseAnonKey, email, password: userPassword, passphrase });
|
|
102
|
+
}
|
|
103
|
+
else if (interactive) {
|
|
104
|
+
let s = startSpinner("Opening your browser to sign in with GitHub...");
|
|
105
|
+
let fallbackUrl;
|
|
106
|
+
try {
|
|
107
|
+
result = await engine.loginWithGithub({
|
|
108
|
+
supabaseUrl,
|
|
109
|
+
supabaseAnonKey,
|
|
110
|
+
passphrase,
|
|
111
|
+
onAuthUrl: (url) => {
|
|
112
|
+
fallbackUrl = url;
|
|
113
|
+
s.stop("Browser opened.");
|
|
114
|
+
log.message(`Didn't open? ${terminalLink("Click here to sign in", url)}`, common);
|
|
115
|
+
s = startSpinner("Waiting for sign in to finish in your browser...");
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
s.stop("Signed in with GitHub.");
|
|
119
|
+
}
|
|
120
|
+
catch (error) {
|
|
121
|
+
s.stop("GitHub sign in failed.");
|
|
122
|
+
if (fallbackUrl)
|
|
123
|
+
log.message(`If the browser didn't open: ${terminalLink("Click here to sign in", fallbackUrl)}`, common);
|
|
124
|
+
throw error;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
result = await engine.loginWithGithub({
|
|
129
|
+
supabaseUrl,
|
|
130
|
+
supabaseAnonKey,
|
|
131
|
+
passphrase,
|
|
132
|
+
onAuthUrl: (url) => console.log(`Opening your browser to sign in with GitHub...\nIf it doesn't open, visit: ${url}`),
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
const message = result.entitled
|
|
136
|
+
? `Logged in as ${result.email}. Sync is active.`
|
|
137
|
+
: `Signed in as ${result.email}, but you don't have an active Pro or Team plan yet. ` +
|
|
138
|
+
`Subscribe at ${PRICING_URL} to start syncing - no need to log in again afterward, just run \`fixmind sync push\`.`;
|
|
139
|
+
if (interactive) {
|
|
140
|
+
outro(message, common);
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
console.log(message);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
finally {
|
|
147
|
+
store.close();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export async function logoutCommand() {
|
|
151
|
+
initializeDataDirectory();
|
|
152
|
+
const store = createLessonStore();
|
|
153
|
+
try {
|
|
154
|
+
const engine = createSyncEngine(store);
|
|
155
|
+
engine.logout();
|
|
156
|
+
console.log("Logged out.");
|
|
157
|
+
}
|
|
158
|
+
finally {
|
|
159
|
+
store.close();
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
export async function syncCommand(sub) {
|
|
163
|
+
if (!sub || !["push", "pull", "status"].includes(sub)) {
|
|
164
|
+
throw new Error("Usage: fixmind sync <push|pull|status>");
|
|
165
|
+
}
|
|
166
|
+
initializeDataDirectory();
|
|
167
|
+
const store = createLessonStore();
|
|
168
|
+
try {
|
|
169
|
+
const engine = createSyncEngine(store);
|
|
170
|
+
if (sub === "status") {
|
|
171
|
+
const status = engine.status();
|
|
172
|
+
if (!status.loggedIn) {
|
|
173
|
+
console.log("Not logged in. Run `fixmind login`.");
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
console.log(`Logged in as ${status.email}.`);
|
|
177
|
+
console.log(`Last push: ${status.lastPushedAt ?? "never"}`);
|
|
178
|
+
console.log(`Last pull: ${status.lastPulledAt ?? "never"}`);
|
|
179
|
+
return;
|
|
180
|
+
}
|
|
181
|
+
if (sub === "push") {
|
|
182
|
+
const result = await engine.push();
|
|
183
|
+
console.log(`Pushed ${result.pushed} lesson(s).`);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
if (sub === "pull") {
|
|
187
|
+
const result = await engine.pull();
|
|
188
|
+
console.log(`Pulled ${result.pulled} change(s), applied ${result.applied} update(s) locally.`);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
finally {
|
|
193
|
+
store.close();
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=cli-sync.js.map
|
|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AAO,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC;gBACnD,OAAO;YACT,CAAC;YACD,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC;YAC7C,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,YAAY,IAAI,OAAO,EAAE,CAAC,CAAC;YAC5D,OAAO,CAAC,GAAG,CAAC,cAAc,MAAM,CAAC,YAAY,IAAI,OAAO,EAAE,CAAC,CAAC;YAC5D,OAAO;QACT,CAAC;QAED,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,aAAa,CAAC,CAAC;YAClD,OAAO;QACT,CAAC;QAED,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;YACnB,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;YACnC,OAAO,CAAC,GAAG,CAAC,UAAU,MAAM,CAAC,MAAM,uBAAuB,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;YAC/F,OAAO;QACT,CAAC;IACH,CAAC;YAAS,CAAC;QACT,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { intro, log, multiselect, note, password, select, text } from "@clack/prompts";
|
|
2
|
+
import type { Lesson } from "./types.js";
|
|
3
|
+
export declare const common: {
|
|
4
|
+
input: NodeJS.ReadStream & {
|
|
5
|
+
fd: 0;
|
|
6
|
+
};
|
|
7
|
+
output: NodeJS.WriteStream & {
|
|
8
|
+
fd: 1;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare function unwrap<T>(value: T | symbol): T;
|
|
12
|
+
export declare function terminalLink(text: string, url: string): string;
|
|
13
|
+
export declare function optionString(value: string | boolean | undefined): string | undefined;
|
|
14
|
+
export declare function numberOption(value: string | boolean | undefined, fallback: number): number;
|
|
15
|
+
export declare function optionalPort(value: string | boolean | undefined): number | undefined;
|
|
16
|
+
export declare function parseList(value?: string): string[];
|
|
17
|
+
export declare function formatDate(value: string): string;
|
|
18
|
+
export declare function formatLessonList(lessons: Lesson[]): string;
|
|
19
|
+
export declare function supportedClientOptions(detected: Array<"codex" | "claude" | "cursor">): Array<{
|
|
20
|
+
value: "codex" | "claude" | "cursor";
|
|
21
|
+
label: string;
|
|
22
|
+
hint?: string;
|
|
23
|
+
}>;
|
|
24
|
+
export declare function validateScope(value: string): "user" | "project";
|
|
25
|
+
export declare function validateClients(values: string[]): Array<"codex" | "claude" | "cursor">;
|
|
26
|
+
export declare function isAddressInUseError(error: unknown): boolean;
|
|
27
|
+
export declare function askText(message: string, fallback: string | undefined, interactive: boolean): Promise<string>;
|
|
28
|
+
export declare function startSpinner(message: string): import("@clack/prompts").SpinnerResult;
|
|
29
|
+
export { intro, log, multiselect, note, password, select, text };
|
|
30
|
+
export declare function parseArgs(argv: string[]): {
|
|
31
|
+
command: string;
|
|
32
|
+
positionals: string[];
|
|
33
|
+
options: Record<string, string | boolean>;
|
|
34
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { stdin, stdout } from "node:process";
|
|
2
|
+
import { parseArgs as nodeParseArgs } from "node:util";
|
|
3
|
+
import { cancel, isCancel, intro, log, multiselect, note, password, select, spinner, text, } from "@clack/prompts";
|
|
4
|
+
export const common = { input: stdin, output: stdout };
|
|
5
|
+
export function unwrap(value) {
|
|
6
|
+
if (isCancel(value)) {
|
|
7
|
+
cancel("Operation cancelled.");
|
|
8
|
+
process.exit(0);
|
|
9
|
+
}
|
|
10
|
+
return value;
|
|
11
|
+
}
|
|
12
|
+
export function terminalLink(text, url) {
|
|
13
|
+
const esc = "\x1b";
|
|
14
|
+
return `${esc}]8;;${url}\u0007${text}${esc}]8;;\u0007`;
|
|
15
|
+
}
|
|
16
|
+
export function optionString(value) {
|
|
17
|
+
return typeof value === "string" ? value : undefined;
|
|
18
|
+
}
|
|
19
|
+
export function numberOption(value, fallback) {
|
|
20
|
+
if (value === undefined)
|
|
21
|
+
return fallback;
|
|
22
|
+
const parsed = Number(value);
|
|
23
|
+
if (!Number.isInteger(parsed) || parsed <= 0)
|
|
24
|
+
throw new Error("--limit must be a positive integer.");
|
|
25
|
+
return parsed;
|
|
26
|
+
}
|
|
27
|
+
export function optionalPort(value) {
|
|
28
|
+
if (value === undefined)
|
|
29
|
+
return undefined;
|
|
30
|
+
const port = Number(value);
|
|
31
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
32
|
+
throw new Error("--port must be an integer from 0 to 65535.");
|
|
33
|
+
}
|
|
34
|
+
return port;
|
|
35
|
+
}
|
|
36
|
+
export function parseList(value) {
|
|
37
|
+
return value?.split(",").map((item) => item.trim()).filter(Boolean) ?? [];
|
|
38
|
+
}
|
|
39
|
+
export function formatDate(value) {
|
|
40
|
+
return new Intl.DateTimeFormat(undefined, { dateStyle: "medium" }).format(new Date(value));
|
|
41
|
+
}
|
|
42
|
+
export function formatLessonList(lessons) {
|
|
43
|
+
if (lessons.length === 0)
|
|
44
|
+
return "No lessons found.";
|
|
45
|
+
return lessons
|
|
46
|
+
.map((lesson) => {
|
|
47
|
+
const concepts = lesson.concepts.join(", ") || "none";
|
|
48
|
+
const suffix = lesson.status === "superseded" ? " [superseded]" : "";
|
|
49
|
+
return [
|
|
50
|
+
`${lesson.id.slice(0, 8)} ${lesson.title}${suffix}`,
|
|
51
|
+
` concepts: ${concepts}`,
|
|
52
|
+
` understanding: ${lesson.understanding} | next review: ${formatDate(lesson.nextReviewAt)}`,
|
|
53
|
+
].join("\n");
|
|
54
|
+
})
|
|
55
|
+
.join("\n\n");
|
|
56
|
+
}
|
|
57
|
+
export function supportedClientOptions(detected) {
|
|
58
|
+
const detectedSet = new Set(detected);
|
|
59
|
+
return [
|
|
60
|
+
{ value: "codex", label: "Codex", hint: detectedSet.has("codex") ? "detected" : undefined },
|
|
61
|
+
{ value: "claude", label: "Claude", hint: detectedSet.has("claude") ? "detected" : undefined },
|
|
62
|
+
{ value: "cursor", label: "Cursor", hint: detectedSet.has("cursor") ? "detected" : undefined },
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
export function validateScope(value) {
|
|
66
|
+
if (value !== "user" && value !== "project")
|
|
67
|
+
throw new Error(`Unsupported scope: ${value}. Use user or project.`);
|
|
68
|
+
return value;
|
|
69
|
+
}
|
|
70
|
+
export function validateClients(values) {
|
|
71
|
+
const supported = new Set(["codex", "claude", "cursor"]);
|
|
72
|
+
const invalid = values.filter((value) => !supported.has(value));
|
|
73
|
+
if (invalid.length) {
|
|
74
|
+
throw new Error(`Unsupported client(s): ${invalid.join(", ")}. Use codex, claude, or cursor.`);
|
|
75
|
+
}
|
|
76
|
+
return [...new Set(values)];
|
|
77
|
+
}
|
|
78
|
+
export function isAddressInUseError(error) {
|
|
79
|
+
if (error == null || typeof error !== "object")
|
|
80
|
+
return false;
|
|
81
|
+
if ("code" in error && error.code === "EADDRINUSE")
|
|
82
|
+
return true;
|
|
83
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
84
|
+
return /address already in use/i.test(message);
|
|
85
|
+
}
|
|
86
|
+
export async function askText(message, fallback, interactive) {
|
|
87
|
+
if (!interactive)
|
|
88
|
+
return fallback ?? "";
|
|
89
|
+
return unwrap(await text({ message, defaultValue: fallback || undefined, ...common }));
|
|
90
|
+
}
|
|
91
|
+
export function startSpinner(message) {
|
|
92
|
+
const state = spinner();
|
|
93
|
+
state.start(message);
|
|
94
|
+
return state;
|
|
95
|
+
}
|
|
96
|
+
export { intro, log, multiselect, note, password, select, text };
|
|
97
|
+
export function parseArgs(argv) {
|
|
98
|
+
const S = { type: "string" };
|
|
99
|
+
const B = { type: "boolean" };
|
|
100
|
+
const { values, positionals } = nodeParseArgs({
|
|
101
|
+
args: argv,
|
|
102
|
+
allowPositionals: true,
|
|
103
|
+
strict: false,
|
|
104
|
+
options: {
|
|
105
|
+
title: S, "original-prompt": S, problem: S, mistake: S, "root-cause": S,
|
|
106
|
+
"fix-summary": S, takeaway: S, "mistake-pattern": S, "when-not-applicable": S,
|
|
107
|
+
concepts: S, "files-changed": S, "code-example": S, "bad-code-example": S,
|
|
108
|
+
"good-code-example": S, "code-explanation": S, "practice-task": S,
|
|
109
|
+
"review-question": S, "expected-answer": S, tool: S, understanding: S,
|
|
110
|
+
tags: S, file: S, format: S, output: S, id: S, limit: S, port: S,
|
|
111
|
+
client: S, scope: S, reason: S, url: S, key: S, email: S, password: S,
|
|
112
|
+
passphrase: S, yes: { ...B, short: "y" }, "include-superseded": B, "no-open": B,
|
|
113
|
+
"dry-run": B, help: B, version: { ...B, short: "v" }, "password-login": B,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
const command = positionals[0];
|
|
117
|
+
return { command, positionals: positionals.slice(1), options: values };
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=cli-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-utils.js","sourceRoot":"","sources":["../../src/cli-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EACL,MAAM,EACN,QAAQ,EACR,KAAK,EACL,GAAG,EACH,WAAW,EACX,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,GACL,MAAM,gBAAgB,CAAC;AAGxB,MAAM,CAAC,MAAM,MAAM,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAEvD,MAAM,UAAU,MAAM,CAAI,KAAiB;IACzC,IAAI,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,sBAAsB,CAAC,CA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