autohand-cli 0.6.2 → 0.6.3
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 -0
- package/dist/chunk-KT55HW6V.js +168 -0
- package/dist/{chunk-7WBK33MM.js → chunk-KZ2UXXLH.js} +4 -2
- package/dist/{chunk-KERHTHMK.js → chunk-KZ4QOKII.js} +9 -7
- package/dist/{chunk-RUQVXU6K.js → chunk-MRQV5HMC.js} +4 -2
- package/dist/chunk-NWXYG5PQ.js +93 -0
- package/dist/chunk-UBGEAEKS.js +1135 -0
- package/dist/{chunk-TVWTD63Y.js → chunk-Z3Q2AFDS.js} +1 -0
- package/dist/{help-CNOV6OXY.js → help-PKC6QCNG.js} +1 -1
- package/dist/index.cjs +9191 -2964
- package/dist/index.js +8009 -2834
- package/dist/{login-Y7XXSNOZ.js → login-MBMAXHG6.js} +3 -2
- package/dist/{logout-6KCD4WA3.js → logout-VI6YMV7P.js} +3 -2
- package/dist/{status-IT5CYW37.js → status-XQSGXTHN.js} +1 -1
- package/dist/theme-B5QZLGKP.js +12 -0
- package/package.json +9 -7
- package/dist/agents-32JB7KMB.js +0 -9
- package/dist/agents-3K6PHXQ6.js +0 -9
- package/dist/agents-A7AUMVQD.js +0 -8
- package/dist/agents-AHFECO5Q.js +0 -9
- package/dist/agents-DQFYBMJG.js +0 -8
- package/dist/agents-GX6L7BXZ.js +0 -9
- package/dist/agents-IWJJ7YJM.js +0 -8
- package/dist/agents-J2QLDVOP.js +0 -9
- package/dist/agents-OWTSY74S.js +0 -9
- package/dist/agents-RB34F4XE.js +0 -9
- package/dist/agents-XL27P67O.js +0 -9
- package/dist/agents-new-5I3B2W2I.js +0 -9
- package/dist/agents-new-CHV2AV34.js +0 -9
- package/dist/agents-new-F6F2VMDB.js +0 -9
- package/dist/agents-new-FDMUH7NL.js +0 -9
- package/dist/agents-new-GBF6JJIA.js +0 -9
- package/dist/agents-new-GCZEY4TE.js +0 -8
- package/dist/agents-new-OCIB72NU.js +0 -9
- package/dist/agents-new-PQGD47BZ.js +0 -9
- package/dist/agents-new-V6BNVJAB.js +0 -9
- package/dist/agents-new-WQUEZ2XH.js +0 -8
- package/dist/chunk-2DEJU7WQ.js +0 -373
- package/dist/chunk-2EPIFDFM.js +0 -68
- package/dist/chunk-2FUWKZFN.js +0 -68
- package/dist/chunk-2HIILNYH.js +0 -197
- package/dist/chunk-2QAL3HH4.js +0 -79
- package/dist/chunk-3FRM7HJY.js +0 -57
- package/dist/chunk-3OD5MR23.js +0 -384
- package/dist/chunk-4LDR3Y3A.js +0 -79
- package/dist/chunk-4LLTISFP.js +0 -288
- package/dist/chunk-4UISIRMD.js +0 -288
- package/dist/chunk-4VWPX2X3.js +0 -131
- package/dist/chunk-7FMMKTRG.js +0 -64
- package/dist/chunk-7MFSCH7E.js +0 -382
- package/dist/chunk-7TV5KURP.js +0 -79
- package/dist/chunk-7XN6PAKV.js +0 -79
- package/dist/chunk-A7HRTONQ.js +0 -382
- package/dist/chunk-ALMJANSA.js +0 -197
- package/dist/chunk-CD7GNBIE.js +0 -288
- package/dist/chunk-CV3LEQRD.js +0 -57
- package/dist/chunk-CYY7D5TQ.js +0 -57
- package/dist/chunk-DAHMHLM6.js +0 -102
- package/dist/chunk-DAMLAWGE.js +0 -68
- package/dist/chunk-F4YPGOQJ.js +0 -105
- package/dist/chunk-FQDXFNOI.js +0 -57
- package/dist/chunk-FQI7EJY2.js +0 -105
- package/dist/chunk-GAJCZDZ5.js +0 -286
- package/dist/chunk-GEOP77H3.js +0 -79
- package/dist/chunk-GRX3IQHC.js +0 -131
- package/dist/chunk-GX24PC3L.js +0 -288
- package/dist/chunk-H53NQAC2.js +0 -131
- package/dist/chunk-HJYISR7Y.js +0 -382
- package/dist/chunk-HLSI4HQM.js +0 -105
- package/dist/chunk-IAOMCEYU.js +0 -68
- package/dist/chunk-J7RENRJG.js +0 -382
- package/dist/chunk-JUDX6E53.js +0 -105
- package/dist/chunk-JZQKOM7X.js +0 -382
- package/dist/chunk-K75NWR5V.js +0 -108
- package/dist/chunk-KCMWJB53.js +0 -288
- package/dist/chunk-KJ4M6KAK.js +0 -57
- package/dist/chunk-L3JXU574.js +0 -77
- package/dist/chunk-LR2XPUPT.js +0 -236
- package/dist/chunk-MCWNGAZG.js +0 -198
- package/dist/chunk-MQTBFYEG.js +0 -288
- package/dist/chunk-NCUJWSGP.js +0 -287
- package/dist/chunk-NWEUBPSG.js +0 -79
- package/dist/chunk-OJ5EBWOQ.js +0 -232
- package/dist/chunk-PKQZWNS2.js +0 -131
- package/dist/chunk-PQJIQBQ5.js +0 -57
- package/dist/chunk-PX5AGAEX.js +0 -105
- package/dist/chunk-Q7HX4VZD.js +0 -197
- package/dist/chunk-QE5RKNVN.js +0 -30
- package/dist/chunk-QLVXFPE3.js +0 -145
- package/dist/chunk-QUC577LO.js +0 -79
- package/dist/chunk-RAL2W5UX.js +0 -55
- package/dist/chunk-RANNBYFJ.js +0 -105
- package/dist/chunk-RCSSFUGL.js +0 -131
- package/dist/chunk-RZ7TASUI.js +0 -57
- package/dist/chunk-SN7D2PJO.js +0 -68
- package/dist/chunk-T4WQUJAE.js +0 -79
- package/dist/chunk-U2Z5BABG.js +0 -57
- package/dist/chunk-UHC4DIK5.js +0 -105
- package/dist/chunk-UNS4S6J3.js +0 -197
- package/dist/chunk-UW2LYWIM.js +0 -131
- package/dist/chunk-VRCQBFSX.js +0 -102
- package/dist/chunk-W76N6IZV.js +0 -197
- package/dist/chunk-WMC556GK.js +0 -131
- package/dist/chunk-WTEZYXD2.js +0 -67
- package/dist/chunk-X7EWON4T.js +0 -105
- package/dist/chunk-XARAKKJ4.js +0 -197
- package/dist/chunk-Y6JDGDEE.js +0 -197
- package/dist/chunk-Y7FSNXMR.js +0 -382
- package/dist/chunk-YPZMUIB5.js +0 -50
- package/dist/chunk-ZMDUVLR4.js +0 -148
- package/dist/chunk-ZRFAICDG.js +0 -382
- package/dist/export-HEFUNSR4.js +0 -8
- package/dist/feedback-3U2WYQK6.js +0 -9
- package/dist/feedback-5IIX372K.js +0 -9
- package/dist/feedback-6S6DWGIU.js +0 -9
- package/dist/feedback-7DEOY2AP.js +0 -9
- package/dist/feedback-BBQT42R6.js +0 -9
- package/dist/feedback-CGCSAWQT.js +0 -9
- package/dist/feedback-NEDFOKMA.js +0 -9
- package/dist/feedback-OXGGJVNA.js +0 -9
- package/dist/feedback-ZJECE2FS.js +0 -8
- package/dist/help-NQUZ7TNJ.js +0 -10
- package/dist/login-D53NQ7UY.js +0 -10
- package/dist/login-GPXDNB2F.js +0 -10
- package/dist/login-HDF4GSTP.js +0 -10
- package/dist/login-HXQ3FDA7.js +0 -10
- package/dist/login-SDAZTJAK.js +0 -10
- package/dist/login-SM6LEDDA.js +0 -10
- package/dist/login-TDI7HBRZ.js +0 -10
- package/dist/logout-32RNT7G2.js +0 -10
- package/dist/logout-43W7N6JU.js +0 -10
- package/dist/logout-BMHTSXIY.js +0 -10
- package/dist/logout-JNNJJYYL.js +0 -10
- package/dist/logout-LW42QASH.js +0 -10
- package/dist/logout-QLWM6P26.js +0 -10
- package/dist/logout-TL7GLGWU.js +0 -10
- package/dist/memory-GVYG653L.js +0 -8
- package/dist/new-MCN36AOD.js +0 -8
- package/dist/status-DCVSUWZG.js +0 -8
- package/dist/status-F6TQOCON.js +0 -8
- package/dist/status-MRJOSVE3.js +0 -8
- package/dist/status-MWFV2DZG.js +0 -8
- package/dist/status-N3PMJRSB.js +0 -8
- package/dist/status-NK7YSBXZ.js +0 -8
- package/dist/status-QLQ5ZKJ3.js +0 -8
- package/dist/status-SQEFMII5.js +0 -8
- package/dist/status-U33PEUBO.js +0 -8
- package/dist/status-XAJH67SE.js +0 -8
package/README.md
CHANGED
|
@@ -307,6 +307,7 @@ docker run -it autohand
|
|
|
307
307
|
|
|
308
308
|
## Documentation
|
|
309
309
|
|
|
310
|
+
- [Playbook](AUTOHAND_PLAYBOOK.md) - 20 use cases for the software development lifecycle
|
|
310
311
|
- [Features](docs/features.md) - Complete feature list
|
|
311
312
|
- [Agent Skills](docs/agent-skills.md) - Skills system guide
|
|
312
313
|
- [Configuration Reference](docs/config-reference.md) - All config options
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AUTH_CONFIG
|
|
3
|
+
} from "./chunk-737A24RB.js";
|
|
4
|
+
|
|
5
|
+
// src/auth/AuthClient.ts
|
|
6
|
+
var DEFAULT_TIMEOUT = 1e4;
|
|
7
|
+
var AuthClient = class {
|
|
8
|
+
constructor(config = {}) {
|
|
9
|
+
this.baseUrl = config.baseUrl || AUTH_CONFIG.apiBaseUrl;
|
|
10
|
+
this.timeout = config.timeout || DEFAULT_TIMEOUT;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Initiate device authorization flow
|
|
14
|
+
* Returns device code and user code for display
|
|
15
|
+
*/
|
|
16
|
+
async initiateDeviceAuth() {
|
|
17
|
+
const controller = new AbortController();
|
|
18
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
19
|
+
try {
|
|
20
|
+
const response = await fetch(`${this.baseUrl}/cli/initiate`, {
|
|
21
|
+
method: "POST",
|
|
22
|
+
headers: {
|
|
23
|
+
"Content-Type": "application/json"
|
|
24
|
+
},
|
|
25
|
+
body: JSON.stringify({ clientId: "autohand-cli" }),
|
|
26
|
+
signal: controller.signal
|
|
27
|
+
});
|
|
28
|
+
clearTimeout(timeoutId);
|
|
29
|
+
const data = await response.json();
|
|
30
|
+
if (!response.ok) {
|
|
31
|
+
return {
|
|
32
|
+
success: false,
|
|
33
|
+
error: data.error || data.message || `HTTP ${response.status}`
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
success: true,
|
|
38
|
+
deviceCode: data.deviceCode,
|
|
39
|
+
userCode: data.userCode,
|
|
40
|
+
verificationUri: data.verificationUri,
|
|
41
|
+
verificationUriComplete: data.verificationUriComplete,
|
|
42
|
+
expiresIn: data.expiresIn,
|
|
43
|
+
interval: data.interval
|
|
44
|
+
};
|
|
45
|
+
} catch (error) {
|
|
46
|
+
clearTimeout(timeoutId);
|
|
47
|
+
if (error.name === "AbortError") {
|
|
48
|
+
return { success: false, error: "Request timeout" };
|
|
49
|
+
}
|
|
50
|
+
return { success: false, error: error.message };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Poll for device authorization status
|
|
55
|
+
*/
|
|
56
|
+
async pollDeviceAuth(deviceCode) {
|
|
57
|
+
const controller = new AbortController();
|
|
58
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
59
|
+
try {
|
|
60
|
+
const response = await fetch(`${this.baseUrl}/cli/poll`, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
"Content-Type": "application/json"
|
|
64
|
+
},
|
|
65
|
+
body: JSON.stringify({ deviceCode }),
|
|
66
|
+
signal: controller.signal
|
|
67
|
+
});
|
|
68
|
+
clearTimeout(timeoutId);
|
|
69
|
+
const data = await response.json();
|
|
70
|
+
if (!response.ok && response.status !== 404) {
|
|
71
|
+
return {
|
|
72
|
+
success: false,
|
|
73
|
+
status: "pending",
|
|
74
|
+
error: data.error || data.message || `HTTP ${response.status}`
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
success: data.success !== false,
|
|
79
|
+
status: data.status || "pending",
|
|
80
|
+
token: data.token,
|
|
81
|
+
user: data.user,
|
|
82
|
+
error: data.error
|
|
83
|
+
};
|
|
84
|
+
} catch (error) {
|
|
85
|
+
clearTimeout(timeoutId);
|
|
86
|
+
if (error.name === "AbortError") {
|
|
87
|
+
return { success: false, status: "pending", error: "Request timeout" };
|
|
88
|
+
}
|
|
89
|
+
return { success: false, status: "pending", error: error.message };
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Validate current session token
|
|
94
|
+
*/
|
|
95
|
+
async validateSession(token) {
|
|
96
|
+
const controller = new AbortController();
|
|
97
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
98
|
+
try {
|
|
99
|
+
const response = await fetch(`${this.baseUrl}/me`, {
|
|
100
|
+
method: "GET",
|
|
101
|
+
headers: {
|
|
102
|
+
"Authorization": `Bearer ${token}`,
|
|
103
|
+
"Cookie": `auth_session=${token}`
|
|
104
|
+
},
|
|
105
|
+
signal: controller.signal
|
|
106
|
+
});
|
|
107
|
+
clearTimeout(timeoutId);
|
|
108
|
+
if (!response.ok) {
|
|
109
|
+
return { authenticated: false };
|
|
110
|
+
}
|
|
111
|
+
const data = await response.json();
|
|
112
|
+
return {
|
|
113
|
+
authenticated: true,
|
|
114
|
+
user: data.user || data
|
|
115
|
+
};
|
|
116
|
+
} catch {
|
|
117
|
+
clearTimeout(timeoutId);
|
|
118
|
+
return { authenticated: false };
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Logout and invalidate session
|
|
123
|
+
*/
|
|
124
|
+
async logout(token) {
|
|
125
|
+
const controller = new AbortController();
|
|
126
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
127
|
+
try {
|
|
128
|
+
const response = await fetch(`${this.baseUrl}/logout`, {
|
|
129
|
+
method: "POST",
|
|
130
|
+
headers: {
|
|
131
|
+
"Authorization": `Bearer ${token}`,
|
|
132
|
+
"Cookie": `auth_session=${token}`
|
|
133
|
+
},
|
|
134
|
+
signal: controller.signal
|
|
135
|
+
});
|
|
136
|
+
clearTimeout(timeoutId);
|
|
137
|
+
return { success: response.ok };
|
|
138
|
+
} catch {
|
|
139
|
+
clearTimeout(timeoutId);
|
|
140
|
+
return { success: true };
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
var instance = null;
|
|
145
|
+
function getAuthClient(config) {
|
|
146
|
+
if (!instance) {
|
|
147
|
+
instance = new AuthClient(config);
|
|
148
|
+
}
|
|
149
|
+
return instance;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export {
|
|
153
|
+
getAuthClient
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* @license
|
|
157
|
+
* Copyright 2025 Autohand AI LLC
|
|
158
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
159
|
+
*
|
|
160
|
+
* Auth API Client for CLI authentication
|
|
161
|
+
*/
|
|
162
|
+
/**
|
|
163
|
+
* @license
|
|
164
|
+
* Copyright 2025 Autohand AI LLC
|
|
165
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
166
|
+
*
|
|
167
|
+
* Auth module exports
|
|
168
|
+
*/
|
|
@@ -5,7 +5,8 @@ import readline from "readline";
|
|
|
5
5
|
// package.json
|
|
6
6
|
var package_default = {
|
|
7
7
|
name: "autohand-cli",
|
|
8
|
-
version: "0.6.
|
|
8
|
+
version: "0.6.3",
|
|
9
|
+
licenses: "SEE LICENSE IN LICENSE",
|
|
9
10
|
description: "Autohand interactive coding agent CLI powered by LLMs.",
|
|
10
11
|
type: "module",
|
|
11
12
|
bin: {
|
|
@@ -18,16 +19,16 @@ var package_default = {
|
|
|
18
19
|
scripts: {
|
|
19
20
|
go: 'bun run build && ./install-local.sh && echo "COMPLETED"',
|
|
20
21
|
build: "tsup src/index.ts --format esm,cjs --dts",
|
|
21
|
-
dev: "
|
|
22
|
+
dev: "bun src/index.ts",
|
|
22
23
|
typecheck: "tsc --noEmit",
|
|
23
24
|
lint: "eslint .",
|
|
24
25
|
test: "vitest run",
|
|
25
26
|
start: "node dist/index.js",
|
|
26
|
-
"compile:macos-arm64": "bun build ./src/index.ts --compile --target=bun-darwin-arm64 --outfile ./binaries/autohand-macos-arm64",
|
|
27
|
-
"compile:macos-x64": "bun build ./src/index.ts --compile --target=bun-darwin-x64 --outfile ./binaries/autohand-macos-x64",
|
|
28
|
-
"compile:linux-x64": "bun build ./src/index.ts --compile --target=bun-linux-x64 --outfile ./binaries/autohand-linux-x64",
|
|
29
|
-
"compile:linux-arm64": "bun build ./src/index.ts --compile --target=bun-linux-arm64 --outfile ./binaries/autohand-linux-arm64",
|
|
30
|
-
"compile:windows-x64": "bun build ./src/index.ts --compile --target=bun-windows-x64 --outfile ./binaries/autohand-windows-x64.exe",
|
|
27
|
+
"compile:macos-arm64": "bun build ./src/index.ts --compile --target=bun-darwin-arm64 --external react-devtools-core --outfile ./binaries/autohand-macos-arm64",
|
|
28
|
+
"compile:macos-x64": "bun build ./src/index.ts --compile --target=bun-darwin-x64 --external react-devtools-core --outfile ./binaries/autohand-macos-x64",
|
|
29
|
+
"compile:linux-x64": "bun build ./src/index.ts --compile --target=bun-linux-x64 --external react-devtools-core --outfile ./binaries/autohand-linux-x64",
|
|
30
|
+
"compile:linux-arm64": "bun build ./src/index.ts --compile --target=bun-linux-arm64 --external react-devtools-core --outfile ./binaries/autohand-linux-arm64",
|
|
31
|
+
"compile:windows-x64": "bun build ./src/index.ts --compile --target=bun-windows-x64 --external react-devtools-core --outfile ./binaries/autohand-windows-x64.exe",
|
|
31
32
|
"compile:all": "bun run compile:macos-arm64 && bun run compile:macos-x64 && bun run compile:linux-x64 && bun run compile:linux-arm64 && bun run compile:windows-x64",
|
|
32
33
|
link: "bun link"
|
|
33
34
|
},
|
|
@@ -49,6 +50,7 @@ var package_default = {
|
|
|
49
50
|
"fs-extra": "^11.3.2",
|
|
50
51
|
ignore: "^5.3.1",
|
|
51
52
|
ink: "^4.4.1",
|
|
53
|
+
"ink-spinner": "^5.0.0",
|
|
52
54
|
open: "^10.1.0",
|
|
53
55
|
ora: "^9.0.0",
|
|
54
56
|
react: "^18.2.0",
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CUSTOM_THEMES_DIR,
|
|
3
|
+
getTheme,
|
|
4
|
+
initTheme,
|
|
5
|
+
isThemeInitialized,
|
|
6
|
+
listAvailableThemes,
|
|
7
|
+
saveConfig
|
|
8
|
+
} from "./chunk-UBGEAEKS.js";
|
|
9
|
+
|
|
10
|
+
// src/commands/theme.ts
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import enquirer from "enquirer";
|
|
13
|
+
async function theme(ctx) {
|
|
14
|
+
const { Select } = enquirer;
|
|
15
|
+
const themes = listAvailableThemes();
|
|
16
|
+
const currentTheme = isThemeInitialized() ? getTheme().name : ctx.config.ui?.theme || "dark";
|
|
17
|
+
console.log(chalk.cyan("\n\u{1F3A8} Theme Selection\n"));
|
|
18
|
+
console.log(chalk.gray(`Current theme: ${chalk.white(currentTheme)}`));
|
|
19
|
+
console.log(chalk.gray(`Custom themes location: ${CUSTOM_THEMES_DIR}
|
|
20
|
+
`));
|
|
21
|
+
const choices = themes.map((name) => ({
|
|
22
|
+
name,
|
|
23
|
+
message: name === currentTheme ? `${name} (current)` : name,
|
|
24
|
+
hint: name === "dark" ? "Default dark theme" : name === "light" ? "Light theme" : "Custom theme"
|
|
25
|
+
}));
|
|
26
|
+
try {
|
|
27
|
+
const prompt = new Select({
|
|
28
|
+
name: "theme",
|
|
29
|
+
message: "Select a theme:",
|
|
30
|
+
choices,
|
|
31
|
+
initial: themes.indexOf(currentTheme)
|
|
32
|
+
});
|
|
33
|
+
const selected = await prompt.run();
|
|
34
|
+
if (selected === currentTheme) {
|
|
35
|
+
console.log(chalk.gray("\nNo change made."));
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
initTheme(selected);
|
|
39
|
+
ctx.config.ui = { ...ctx.config.ui, theme: selected };
|
|
40
|
+
await saveConfig(ctx.config);
|
|
41
|
+
console.log(chalk.green(`
|
|
42
|
+
\u2713 Theme changed to '${selected}'`));
|
|
43
|
+
const newTheme = getTheme();
|
|
44
|
+
console.log("\nTheme preview:");
|
|
45
|
+
console.log(` ${newTheme.fg("accent", "\u25CF accent")} ${newTheme.fg("success", "\u25CF success")} ${newTheme.fg("error", "\u25CF error")} ${newTheme.fg("warning", "\u25CF warning")}`);
|
|
46
|
+
console.log(` ${newTheme.fg("muted", "\u25CF muted")} ${newTheme.fg("dim", "\u25CF dim")} ${newTheme.fg("text", "\u25CF text")}`);
|
|
47
|
+
console.log();
|
|
48
|
+
return null;
|
|
49
|
+
} catch {
|
|
50
|
+
console.log(chalk.gray("\nTheme selection cancelled."));
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
async function themeInfo() {
|
|
55
|
+
if (!isThemeInitialized()) {
|
|
56
|
+
console.log(chalk.yellow("Theme not initialized."));
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
59
|
+
const currentTheme = getTheme();
|
|
60
|
+
console.log(chalk.cyan("\n\u{1F3A8} Current Theme Info\n"));
|
|
61
|
+
console.log(chalk.gray(`Name: ${chalk.white(currentTheme.name)}`));
|
|
62
|
+
console.log(chalk.gray(`Color mode: ${chalk.white(currentTheme.getColorMode())}`));
|
|
63
|
+
console.log(chalk.gray(`Custom themes dir: ${CUSTOM_THEMES_DIR}`));
|
|
64
|
+
console.log();
|
|
65
|
+
console.log("Color preview:");
|
|
66
|
+
console.log(` ${currentTheme.fg("accent", "\u25CF accent")} ${currentTheme.fg("success", "\u25CF success")} ${currentTheme.fg("error", "\u25CF error")} ${currentTheme.fg("warning", "\u25CF warning")}`);
|
|
67
|
+
console.log(` ${currentTheme.fg("muted", "\u25CF muted")} ${currentTheme.fg("dim", "\u25CF dim")} ${currentTheme.fg("text", "\u25CF text")}`);
|
|
68
|
+
console.log();
|
|
69
|
+
console.log("Syntax colors:");
|
|
70
|
+
console.log(` ${currentTheme.fg("syntaxKeyword", "keyword")} ${currentTheme.fg("syntaxString", '"string"')} ${currentTheme.fg("syntaxNumber", "42")} ${currentTheme.fg("syntaxComment", "// comment")}`);
|
|
71
|
+
console.log(` ${currentTheme.fg("syntaxFunction", "function")} ${currentTheme.fg("syntaxType", "Type")} ${currentTheme.fg("syntaxVariable", "variable")}`);
|
|
72
|
+
console.log();
|
|
73
|
+
console.log("Diff colors:");
|
|
74
|
+
console.log(` ${currentTheme.fg("diffAdded", "+ added")} ${currentTheme.fg("diffRemoved", "- removed")} ${currentTheme.fg("diffContext", " context")}`);
|
|
75
|
+
console.log();
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
var metadata = {
|
|
79
|
+
command: "/theme",
|
|
80
|
+
description: "change the color theme",
|
|
81
|
+
implemented: true
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export {
|
|
85
|
+
theme,
|
|
86
|
+
themeInfo,
|
|
87
|
+
metadata
|
|
88
|
+
};
|
|
89
|
+
/**
|
|
90
|
+
* @license
|
|
91
|
+
* Copyright 2025 Autohand AI LLC
|
|
92
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
93
|
+
*/
|