autohand-cli 0.7.6 → 0.7.7
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/dist/{AutomodeManager-TJSW2SQY.cjs → AutomodeManager-HV6M7EAX.cjs} +61 -22
- package/dist/{AutomodeManager-WIMHLG4W.js → AutomodeManager-YVCJXOMQ.js} +61 -22
- package/dist/CommunitySkillsCache-2BITCEAA.cjs +7 -0
- package/dist/{CommunitySkillsCache-XPDVYU3K.js → CommunitySkillsCache-Q22FUAR5.js} +2 -2
- package/dist/HookManager-X47HCM5G.cjs +6 -0
- package/dist/{HookManager-VIX56KFU.js → HookManager-ZXKHCD7U.js} +1 -1
- package/dist/MemoryManager-2ATHG7BH.js +7 -0
- package/dist/MemoryManager-AENCGCEW.cjs +7 -0
- package/dist/PermissionManager-6HZGTK2N.cjs +10 -0
- package/dist/{PermissionManager-YFZI4ZZ6.js → PermissionManager-HATZKTRC.js} +3 -3
- package/dist/SessionManager-AG4WT3DP.cjs +9 -0
- package/dist/{SessionManager-XDBEQUPG.js → SessionManager-S5R6O3NU.js} +2 -2
- package/dist/{SkillsRegistry-7NICF6FY.js → SkillsRegistry-R5WDM6T3.js} +2 -2
- package/dist/SkillsRegistry-ZXU6YDRP.cjs +8 -0
- package/dist/SyncApiClient-FAOMIZAP.js +10 -0
- package/dist/SyncApiClient-UOA4VLLD.cjs +10 -0
- package/dist/add-dir-OMK3Y4DM.cjs +8 -0
- package/dist/add-dir-PNU7AGKO.js +8 -0
- package/dist/{agents-B33IAATH.js → agents-ICAC3KD3.js} +2 -2
- package/dist/agents-YONWPKFS.cjs +9 -0
- package/dist/agents-new-NV557UVG.cjs +10 -0
- package/dist/{agents-new-KTXJFC5E.js → agents-new-QHM3CO4B.js} +2 -2
- package/dist/{chunk-MFLRXVKU.js → chunk-23JQSCTO.js} +1 -1
- package/dist/chunk-2JPUEN44.cjs +299 -0
- package/dist/{chunk-5PD2L6WI.js → chunk-3YEDXG6S.js} +1 -1
- package/dist/{chunk-3ZUWWML7.cjs → chunk-4M2GX7RH.cjs} +2 -2
- package/dist/{chunk-R5KNHJ27.js → chunk-4RWTUT2Z.js} +1 -1
- package/dist/{chunk-CHQMK2ZG.js → chunk-52MLYK5P.js} +1 -1
- package/dist/{chunk-CVYEUA3D.cjs → chunk-53BR4MUW.cjs} +3 -3
- package/dist/{chunk-5WKR4HIB.js → chunk-5DN5KNXU.js} +1 -1
- package/dist/{chunk-3CO5R6M2.cjs → chunk-7TOHYAUF.cjs} +2 -2
- package/dist/{chunk-67NJKV5A.cjs → chunk-7VW3A7DO.cjs} +2 -2
- package/dist/{chunk-2W3QTBNG.cjs → chunk-A552JHUJ.cjs} +2 -2
- package/dist/{chunk-NGSLABLS.js → chunk-A6QBABQ7.js} +1 -1
- package/dist/chunk-ARVFUZOB.js +736 -0
- package/dist/{chunk-VO3JKFUH.js → chunk-AVL4DKQO.js} +1 -1
- package/dist/{chunk-CT2VTDPQ.cjs → chunk-B4ZPNXZE.cjs} +1 -1
- package/dist/{chunk-OKMYLMCR.cjs → chunk-B7EUETGY.cjs} +4 -4
- package/dist/chunk-C26EN22G.cjs +328 -0
- package/dist/chunk-DOTAX65F.js +328 -0
- package/dist/{chunk-SKT2CRNY.cjs → chunk-DSKVMFRM.cjs} +56 -8
- package/dist/{chunk-FUEL6BK7.js → chunk-EKY5PKQI.js} +15 -0
- package/dist/{chunk-YMP7AGNT.js → chunk-G77ZY4QG.js} +1 -1
- package/dist/{chunk-KN5C4TR4.cjs → chunk-GDTZQSJ6.cjs} +2 -2
- package/dist/{chunk-536VWSZK.cjs → chunk-GFJ6AETU.cjs} +4 -4
- package/dist/{chunk-723DZKBU.js → chunk-GR7VWN63.js} +2 -2
- package/dist/{chunk-PVM5I5WI.js → chunk-GWIAMKKF.js} +1 -1
- package/dist/{chunk-XAM7SFVB.cjs → chunk-GWXXFQ3F.cjs} +2 -2
- package/dist/{chunk-REPKBECD.cjs → chunk-JHFH3N4U.cjs} +2 -2
- package/dist/{chunk-4L5WYXHN.js → chunk-KH7BCZJN.js} +1 -1
- package/dist/{chunk-JXOXZTMA.js → chunk-L5ZFPWHY.js} +54 -6
- package/dist/chunk-MDWULS57.js +288 -0
- package/dist/{chunk-6LP2GO5C.js → chunk-MJFBVQHB.js} +2 -2
- package/dist/{chunk-MWLAHCU7.js → chunk-NI3BQXKU.js} +1 -1
- package/dist/{chunk-KJ67C72C.cjs → chunk-NYQVQYIF.cjs} +2 -2
- package/dist/{chunk-SKU4M27Z.js → chunk-OBV3UUIL.js} +1 -1
- package/dist/{chunk-27ISZOFA.js → chunk-P2Z6GDEN.js} +1 -1
- package/dist/{chunk-XTHHDIBG.cjs → chunk-PMMSDR44.cjs} +16 -1
- package/dist/{chunk-K6NBYSME.cjs → chunk-PR53E47T.cjs} +6 -6
- package/dist/{chunk-URY4AS4L.cjs → chunk-PU534KPO.cjs} +4 -4
- package/dist/{chunk-5MCDN53U.js → chunk-Q3WCMY3Z.js} +4 -2
- package/dist/{chunk-4KZCGK7D.js → chunk-QXAPHGEW.js} +1 -1
- package/dist/chunk-SFGJQPGC.cjs +288 -0
- package/dist/{chunk-53YDUYNS.cjs → chunk-SLISYSP4.cjs} +2 -2
- package/dist/{chunk-2E2COWKB.cjs → chunk-SYJLMBLP.cjs} +66 -10
- package/dist/chunk-U5WIP4HS.js +674 -0
- package/dist/{chunk-7HB7GSQF.js → chunk-UL7YPRCU.js} +1 -1
- package/dist/{chunk-JYTXG6OV.cjs → chunk-VDZJ3W4M.cjs} +4 -2
- package/dist/{chunk-LUKMRIKJ.cjs → chunk-VEDIYPWY.cjs} +2 -2
- package/dist/{chunk-C2NFLFHH.js → chunk-VPAN5H7Q.js} +1 -1
- package/dist/chunk-WH3D42BQ.js +299 -0
- package/dist/{chunk-2FSQPRPJ.js → chunk-WIUGUR5T.js} +59 -3
- package/dist/{chunk-QMVTT55Y.cjs → chunk-WQSWU2QA.cjs} +4 -4
- package/dist/chunk-XFPITUFJ.cjs +674 -0
- package/dist/chunk-XFQS2VGT.cjs +736 -0
- package/dist/{chunk-HYTYXN2G.cjs → chunk-YAGD43KA.cjs} +10 -10
- package/dist/constants-G2PLP5HH.cjs +20 -0
- package/dist/{constants-QYBEF3DB.js → constants-ZLG6M5SI.js} +3 -1
- package/dist/{defaultHooks-3G3DVF6I.js → defaultHooks-R56VYG7I.js} +315 -1
- package/dist/{defaultHooks-Z4KA6U5C.cjs → defaultHooks-WLMRQUXG.cjs} +315 -1
- package/dist/{feedback-PZ2PINDU.js → feedback-HZBCTSFG.js} +2 -2
- package/dist/feedback-JBQ3UPGZ.cjs +10 -0
- package/dist/index.cjs +897 -600
- package/dist/index.js +1438 -1141
- package/dist/language-KODBDE5R.js +12 -0
- package/dist/language-SJT475NW.cjs +12 -0
- package/dist/localProjectPermissions-AYQYGTOE.cjs +17 -0
- package/dist/{localProjectPermissions-DURCNDZG.js → localProjectPermissions-YFFAKLUZ.js} +2 -2
- package/dist/login-TC2KROQI.js +14 -0
- package/dist/login-TYMR2ZD3.cjs +14 -0
- package/dist/logout-2ECV365P.js +12 -0
- package/dist/logout-CO3CPYZJ.cjs +12 -0
- package/dist/resume-EPOEF3WV.cjs +9 -0
- package/dist/{resume-CWYAK6XR.js → resume-LOYD5MMP.js} +2 -2
- package/dist/share-544SIZOY.js +10 -0
- package/dist/share-OETK2GUF.cjs +10 -0
- package/dist/{skills-CRFOVWEQ.js → skills-3YEEODHK.js} +1 -1
- package/dist/skills-CRM55MKM.cjs +12 -0
- package/dist/{skills-install-Z27KPEGF.cjs → skills-install-FTGOHOZ4.cjs} +5 -5
- package/dist/{skills-install-RMPXN6RK.js → skills-install-KAXAQSN6.js} +2 -2
- package/dist/skills-new-JF4FKNUT.cjs +11 -0
- package/dist/{skills-new-S2YPO635.js → skills-new-JYX2GBKM.js} +2 -2
- package/dist/{status-GPAZ67ZZ.js → status-7LCXYYY4.js} +2 -2
- package/dist/status-E7MZEQ26.cjs +9 -0
- package/dist/sync-3B7SNBYC.js +14 -0
- package/dist/sync-4RARBQIH.cjs +39 -0
- package/dist/sync-H4UHHLKU.js +39 -0
- package/dist/sync-YZ6YZ42H.cjs +14 -0
- package/dist/theme-3XV5BWUB.js +12 -0
- package/dist/theme-Z2WS5XWZ.cjs +12 -0
- package/package.json +4 -2
- package/dist/CommunitySkillsCache-X3X237QQ.cjs +0 -7
- package/dist/HookManager-EOMUXKJ4.cjs +0 -6
- package/dist/MemoryManager-UVHILGV5.js +0 -7
- package/dist/MemoryManager-WO3KUZVA.cjs +0 -7
- package/dist/PermissionManager-PMTQN263.cjs +0 -10
- package/dist/SessionManager-M5ZLCLCW.cjs +0 -9
- package/dist/SkillsRegistry-OINIPILA.cjs +0 -8
- package/dist/agents-GRAFXZY3.cjs +0 -9
- package/dist/agents-new-67NJJSDA.cjs +0 -10
- package/dist/constants-PE5DLI7Q.cjs +0 -18
- package/dist/feedback-R66B3B3C.cjs +0 -10
- package/dist/localProjectPermissions-75X3ZGKH.cjs +0 -17
- package/dist/login-NYWZRZO5.js +0 -12
- package/dist/login-QNJ5C42G.cjs +0 -12
- package/dist/logout-MBS7L3ZW.js +0 -12
- package/dist/logout-MVUP7GPU.cjs +0 -12
- package/dist/resume-ANISKRWL.cjs +0 -9
- package/dist/share-3PSV53CQ.js +0 -10
- package/dist/share-4ACH6626.cjs +0 -10
- package/dist/skills-6PIGHOWS.cjs +0 -12
- package/dist/skills-new-3QJUST7P.cjs +0 -11
- package/dist/status-4U5CPUVT.cjs +0 -9
- package/dist/theme-CVY6MVEK.cjs +0 -12
- package/dist/theme-CY7WF4M6.js +0 -12
|
@@ -6,7 +6,7 @@ var _chunkJHGIWNHLcjs = require('./chunk-JHGIWNHL.cjs');
|
|
|
6
6
|
var _chunk3HPUOQJNcjs = require('./chunk-3HPUOQJN.cjs');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunkPMMSDR44cjs = require('./chunk-PMMSDR44.cjs');
|
|
10
10
|
|
|
11
11
|
// src/commands/skills-new.ts
|
|
12
12
|
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
|
|
@@ -160,7 +160,7 @@ Output only the raw markdown content, no code fences.`
|
|
|
160
160
|
console.log(_chalk2.default.gray("Canceled."));
|
|
161
161
|
return null;
|
|
162
162
|
}
|
|
163
|
-
const baseDir = storageLevel === "project" ? _path2.default.join(ctx.workspaceRoot, ".autohand", "skills") :
|
|
163
|
+
const baseDir = storageLevel === "project" ? _path2.default.join(ctx.workspaceRoot, ".autohand", "skills") : _chunkPMMSDR44cjs.AUTOHAND_PATHS.skills;
|
|
164
164
|
const skillDir = _path2.default.join(baseDir, name);
|
|
165
165
|
const skillPath = _path2.default.join(skillDir, "SKILL.md");
|
|
166
166
|
try {
|
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import {
|
|
2
|
+
loadConfig,
|
|
3
|
+
saveConfig
|
|
4
|
+
} from "./chunk-GWIAMKKF.js";
|
|
5
|
+
|
|
6
|
+
// src/commands/sync.ts
|
|
7
|
+
import chalk from "chalk";
|
|
8
|
+
import readline from "readline";
|
|
9
|
+
var metadata = {
|
|
10
|
+
command: "/sync",
|
|
11
|
+
description: "Manage settings sync (view status, enable/disable, trigger sync)",
|
|
12
|
+
implemented: true
|
|
13
|
+
};
|
|
14
|
+
var globalSyncService = null;
|
|
15
|
+
function setSyncService(service) {
|
|
16
|
+
globalSyncService = service;
|
|
17
|
+
}
|
|
18
|
+
function getSyncService() {
|
|
19
|
+
return globalSyncService;
|
|
20
|
+
}
|
|
21
|
+
async function sync(ctx) {
|
|
22
|
+
const config = await loadConfig();
|
|
23
|
+
const isLoggedIn = Boolean(config.auth?.token && config.auth?.user);
|
|
24
|
+
if (!isLoggedIn) {
|
|
25
|
+
console.log(chalk.yellow("\nSettings sync requires authentication."));
|
|
26
|
+
console.log(chalk.gray("Run /login to sign in and enable cloud sync.\n"));
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
const data = await gatherSyncData(ctx, config);
|
|
30
|
+
await renderSyncUI(data, ctx);
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
async function gatherSyncData(ctx, config) {
|
|
34
|
+
const syncService = globalSyncService;
|
|
35
|
+
let status = {
|
|
36
|
+
enabled: false,
|
|
37
|
+
syncing: false,
|
|
38
|
+
lastSync: null,
|
|
39
|
+
fileCount: 0,
|
|
40
|
+
totalSize: 0
|
|
41
|
+
};
|
|
42
|
+
if (syncService) {
|
|
43
|
+
try {
|
|
44
|
+
status = await syncService.getStatus();
|
|
45
|
+
} catch {
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return {
|
|
49
|
+
enabled: config.sync?.enabled !== false,
|
|
50
|
+
isRunning: syncService?.isRunning ?? false,
|
|
51
|
+
lastSync: status.lastSync,
|
|
52
|
+
fileCount: status.fileCount,
|
|
53
|
+
totalSize: status.totalSize,
|
|
54
|
+
interval: config.sync?.interval ?? 3e5,
|
|
55
|
+
syncService,
|
|
56
|
+
isLoggedIn: Boolean(config.auth?.token),
|
|
57
|
+
includeTelemetry: config.sync?.includeTelemetry ?? false,
|
|
58
|
+
includeFeedback: config.sync?.includeFeedback ?? false
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
function renderSyncUI(data, ctx) {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
const tabs = ["Status", "Settings", "Activity"];
|
|
64
|
+
let currentTab = 0;
|
|
65
|
+
let needsRefresh = false;
|
|
66
|
+
const input = process.stdin;
|
|
67
|
+
const isTTY = input.isTTY;
|
|
68
|
+
const wasRaw = input.isRaw;
|
|
69
|
+
const wasPaused = typeof input.isPaused === "function" ? input.isPaused() : false;
|
|
70
|
+
if (wasPaused && typeof input.resume === "function") {
|
|
71
|
+
input.resume();
|
|
72
|
+
}
|
|
73
|
+
if (isTTY) {
|
|
74
|
+
readline.emitKeypressEvents(input);
|
|
75
|
+
if (!wasRaw && typeof input.setRawMode === "function") {
|
|
76
|
+
input.setRawMode(true);
|
|
77
|
+
}
|
|
78
|
+
if (typeof input.setEncoding === "function") {
|
|
79
|
+
input.setEncoding("utf8");
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
const render = () => {
|
|
83
|
+
process.stdout.write("\x1B[2J\x1B[H");
|
|
84
|
+
renderTabHeader(tabs, currentTab);
|
|
85
|
+
renderTabContent(tabs[currentTab], data);
|
|
86
|
+
console.log(chalk.gray("\nEsc to exit | Tab to cycle | s: sync now | e: toggle enabled"));
|
|
87
|
+
};
|
|
88
|
+
let buffer = "";
|
|
89
|
+
const handler = async (chunk) => {
|
|
90
|
+
buffer += typeof chunk === "string" ? chunk : chunk.toString("utf8");
|
|
91
|
+
const processNext = async () => {
|
|
92
|
+
if (!buffer.length) return false;
|
|
93
|
+
const first = buffer[0];
|
|
94
|
+
if (first === "\x1B") {
|
|
95
|
+
if (buffer.length === 1) return false;
|
|
96
|
+
if (buffer[1] === "[") {
|
|
97
|
+
if (buffer.length < 3) return false;
|
|
98
|
+
const seq = buffer.slice(0, 3);
|
|
99
|
+
buffer = buffer.slice(3);
|
|
100
|
+
await handleSequence(seq);
|
|
101
|
+
return true;
|
|
102
|
+
}
|
|
103
|
+
buffer = buffer.slice(1);
|
|
104
|
+
await handleSequence("\x1B");
|
|
105
|
+
return true;
|
|
106
|
+
}
|
|
107
|
+
buffer = buffer.slice(1);
|
|
108
|
+
await handleSequence(first);
|
|
109
|
+
return true;
|
|
110
|
+
};
|
|
111
|
+
while (await processNext()) {
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
const handleSequence = async (sequence) => {
|
|
115
|
+
switch (sequence) {
|
|
116
|
+
case "\x1B":
|
|
117
|
+
// ESC
|
|
118
|
+
case "":
|
|
119
|
+
cleanup();
|
|
120
|
+
resolve();
|
|
121
|
+
return;
|
|
122
|
+
case " ":
|
|
123
|
+
// Tab
|
|
124
|
+
case "\x1B[C":
|
|
125
|
+
currentTab = (currentTab + 1) % tabs.length;
|
|
126
|
+
render();
|
|
127
|
+
return;
|
|
128
|
+
case "\x1B[Z":
|
|
129
|
+
// Shift+Tab
|
|
130
|
+
case "\x1B[D":
|
|
131
|
+
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
132
|
+
render();
|
|
133
|
+
return;
|
|
134
|
+
case "s":
|
|
135
|
+
case "S":
|
|
136
|
+
if (data.syncService) {
|
|
137
|
+
console.log(chalk.cyan("\nSyncing..."));
|
|
138
|
+
try {
|
|
139
|
+
const result = await data.syncService.sync();
|
|
140
|
+
if (result.success) {
|
|
141
|
+
console.log(chalk.green(`Sync complete! Uploaded: ${result.uploaded}, Downloaded: ${result.downloaded}`));
|
|
142
|
+
} else {
|
|
143
|
+
console.log(chalk.red(`Sync failed: ${result.error}`));
|
|
144
|
+
}
|
|
145
|
+
const config = await loadConfig();
|
|
146
|
+
Object.assign(data, await gatherSyncData(ctx, config));
|
|
147
|
+
} catch (err) {
|
|
148
|
+
console.log(chalk.red(`Sync error: ${err}`));
|
|
149
|
+
}
|
|
150
|
+
await sleep(1500);
|
|
151
|
+
render();
|
|
152
|
+
}
|
|
153
|
+
return;
|
|
154
|
+
case "e":
|
|
155
|
+
case "E":
|
|
156
|
+
try {
|
|
157
|
+
const config = await loadConfig();
|
|
158
|
+
const newEnabled = config.sync?.enabled === false;
|
|
159
|
+
config.sync = { ...config.sync, enabled: newEnabled };
|
|
160
|
+
await saveConfig(config);
|
|
161
|
+
data.enabled = newEnabled;
|
|
162
|
+
console.log(chalk.cyan(`
|
|
163
|
+
Sync ${newEnabled ? "enabled" : "disabled"}`));
|
|
164
|
+
await sleep(1e3);
|
|
165
|
+
render();
|
|
166
|
+
} catch (err) {
|
|
167
|
+
console.log(chalk.red(`Error toggling sync: ${err}`));
|
|
168
|
+
}
|
|
169
|
+
return;
|
|
170
|
+
default:
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
const cleanup = () => {
|
|
175
|
+
input.off("data", handler);
|
|
176
|
+
if (isTTY && !wasRaw && typeof input.setRawMode === "function") {
|
|
177
|
+
input.setRawMode(false);
|
|
178
|
+
}
|
|
179
|
+
if (wasPaused && typeof input.pause === "function") {
|
|
180
|
+
input.pause();
|
|
181
|
+
}
|
|
182
|
+
process.stdout.write("\x1B[2J\x1B[H");
|
|
183
|
+
};
|
|
184
|
+
input.on("data", handler);
|
|
185
|
+
render();
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
function renderTabHeader(tabs, currentIndex) {
|
|
189
|
+
const header = tabs.map((tab, i) => {
|
|
190
|
+
return i === currentIndex ? chalk.bgWhite.black(` ${tab} `) : chalk.gray(` ${tab} `);
|
|
191
|
+
}).join(" ");
|
|
192
|
+
console.log(`Settings Sync: ${header} ${chalk.gray("(tab to cycle)")}
|
|
193
|
+
`);
|
|
194
|
+
}
|
|
195
|
+
function renderTabContent(tab, data) {
|
|
196
|
+
switch (tab) {
|
|
197
|
+
case "Status":
|
|
198
|
+
renderStatusTab(data);
|
|
199
|
+
break;
|
|
200
|
+
case "Settings":
|
|
201
|
+
renderSettingsTab(data);
|
|
202
|
+
break;
|
|
203
|
+
case "Activity":
|
|
204
|
+
renderActivityTab(data);
|
|
205
|
+
break;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
function renderStatusTab(data) {
|
|
209
|
+
console.log(chalk.bold("Sync Status\n"));
|
|
210
|
+
const statusIcon = data.enabled ? chalk.green("\u2713") : chalk.red("\u2717");
|
|
211
|
+
const runningIcon = data.isRunning ? chalk.green("\u2713") : chalk.yellow("\u25CB");
|
|
212
|
+
console.log(` ${chalk.cyan("Enabled".padEnd(20))} ${statusIcon} ${data.enabled ? "Yes" : "No"}`);
|
|
213
|
+
console.log(` ${chalk.cyan("Service Running".padEnd(20))} ${runningIcon} ${data.isRunning ? "Yes" : "No"}`);
|
|
214
|
+
console.log(` ${chalk.cyan("Last Sync".padEnd(20))} ${data.lastSync ? formatDate(data.lastSync) : chalk.gray("Never")}`);
|
|
215
|
+
console.log(` ${chalk.cyan("Files Tracked".padEnd(20))} ${data.fileCount}`);
|
|
216
|
+
console.log(` ${chalk.cyan("Total Size".padEnd(20))} ${formatSize(data.totalSize)}`);
|
|
217
|
+
console.log(` ${chalk.cyan("Sync Interval".padEnd(20))} ${formatInterval(data.interval)}`);
|
|
218
|
+
}
|
|
219
|
+
function renderSettingsTab(data) {
|
|
220
|
+
console.log(chalk.bold("Sync Settings\n"));
|
|
221
|
+
console.log(` ${chalk.cyan("Enabled".padEnd(25))} ${data.enabled ? chalk.green("true") : chalk.gray("false")}`);
|
|
222
|
+
console.log(` ${chalk.cyan("Interval".padEnd(25))} ${formatInterval(data.interval)}`);
|
|
223
|
+
console.log(` ${chalk.cyan("Include Telemetry".padEnd(25))} ${data.includeTelemetry ? chalk.green("true") : chalk.gray("false")}`);
|
|
224
|
+
console.log(` ${chalk.cyan("Include Feedback".padEnd(25))} ${data.includeFeedback ? chalk.green("true") : chalk.gray("false")}`);
|
|
225
|
+
console.log(chalk.bold("\nWhat Gets Synced\n"));
|
|
226
|
+
console.log(chalk.gray(" \u2713 config.json (API keys encrypted)"));
|
|
227
|
+
console.log(chalk.gray(" \u2713 agents/ (custom agents)"));
|
|
228
|
+
console.log(chalk.gray(" \u2713 skills/ (custom skills)"));
|
|
229
|
+
console.log(chalk.gray(" \u2713 hooks/ (user hooks)"));
|
|
230
|
+
console.log(chalk.gray(" \u2713 memory/ (user memory)"));
|
|
231
|
+
console.log(chalk.gray(" \u2713 sessions/ (session history)"));
|
|
232
|
+
console.log(chalk.gray(" \u2713 projects/ (project knowledge)"));
|
|
233
|
+
console.log(chalk.bold("\nNot Synced\n"));
|
|
234
|
+
console.log(chalk.gray(" \u2717 device-id (unique per device)"));
|
|
235
|
+
console.log(chalk.gray(" \u2717 error.log (local only)"));
|
|
236
|
+
console.log(chalk.gray(" \u2717 version-*.json (cache files)"));
|
|
237
|
+
}
|
|
238
|
+
function renderActivityTab(data) {
|
|
239
|
+
console.log(chalk.bold("Recent Sync Activity\n"));
|
|
240
|
+
if (!data.lastSync) {
|
|
241
|
+
console.log(chalk.gray(" No sync activity yet."));
|
|
242
|
+
console.log(chalk.gray(' Press "s" to trigger a manual sync.'));
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
console.log(` ${chalk.cyan("Last successful sync:")} ${formatDate(data.lastSync)}`);
|
|
246
|
+
console.log(` ${chalk.cyan("Files synced:")} ${data.fileCount}`);
|
|
247
|
+
console.log(` ${chalk.cyan("Data transferred:")} ${formatSize(data.totalSize)}`);
|
|
248
|
+
console.log(chalk.bold("\nTips\n"));
|
|
249
|
+
console.log(chalk.gray(" - Sync runs automatically every 5 minutes"));
|
|
250
|
+
console.log(chalk.gray(' - Press "s" anytime to trigger a manual sync'));
|
|
251
|
+
console.log(chalk.gray(" - Cloud data takes priority on conflicts"));
|
|
252
|
+
}
|
|
253
|
+
function formatDate(isoString) {
|
|
254
|
+
try {
|
|
255
|
+
const date = new Date(isoString);
|
|
256
|
+
const now = /* @__PURE__ */ new Date();
|
|
257
|
+
const diff = now.getTime() - date.getTime();
|
|
258
|
+
if (diff < 6e4) {
|
|
259
|
+
return "Just now";
|
|
260
|
+
} else if (diff < 36e5) {
|
|
261
|
+
const mins = Math.floor(diff / 6e4);
|
|
262
|
+
return `${mins} minute${mins > 1 ? "s" : ""} ago`;
|
|
263
|
+
} else if (diff < 864e5) {
|
|
264
|
+
const hours = Math.floor(diff / 36e5);
|
|
265
|
+
return `${hours} hour${hours > 1 ? "s" : ""} ago`;
|
|
266
|
+
} else {
|
|
267
|
+
return date.toLocaleDateString() + " " + date.toLocaleTimeString();
|
|
268
|
+
}
|
|
269
|
+
} catch {
|
|
270
|
+
return isoString;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function formatSize(bytes) {
|
|
274
|
+
if (bytes === 0) return "0 B";
|
|
275
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
276
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
277
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
278
|
+
}
|
|
279
|
+
function formatInterval(ms) {
|
|
280
|
+
const minutes = Math.floor(ms / 6e4);
|
|
281
|
+
if (minutes < 60) return `${minutes} minute${minutes > 1 ? "s" : ""}`;
|
|
282
|
+
const hours = Math.floor(minutes / 60);
|
|
283
|
+
return `${hours} hour${hours > 1 ? "s" : ""}`;
|
|
284
|
+
}
|
|
285
|
+
function sleep(ms) {
|
|
286
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
export {
|
|
290
|
+
metadata,
|
|
291
|
+
setSyncService,
|
|
292
|
+
getSyncService,
|
|
293
|
+
sync
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* @license
|
|
297
|
+
* Copyright 2025 Autohand AI LLC
|
|
298
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
299
|
+
*/
|
|
@@ -1,15 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_SYNC_CONFIG,
|
|
3
|
+
createSyncService
|
|
4
|
+
} from "./chunk-U5WIP4HS.js";
|
|
1
5
|
import {
|
|
2
6
|
getAuthClient
|
|
3
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-52MLYK5P.js";
|
|
4
8
|
import {
|
|
5
9
|
saveConfig
|
|
6
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-GWIAMKKF.js";
|
|
7
11
|
import {
|
|
8
12
|
safePrompt
|
|
9
13
|
} from "./chunk-7BYSXAKS.js";
|
|
10
14
|
import {
|
|
11
15
|
AUTH_CONFIG
|
|
12
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-EKY5PKQI.js";
|
|
13
17
|
|
|
14
18
|
// src/commands/login.ts
|
|
15
19
|
import chalk from "chalk";
|
|
@@ -111,6 +115,7 @@ async function login(ctx) {
|
|
|
111
115
|
console.log(chalk.green("Login successful!"));
|
|
112
116
|
console.log(chalk.cyan(`Welcome, ${pollResult.user.name || pollResult.user.email}!`));
|
|
113
117
|
console.log();
|
|
118
|
+
await checkAndRestoreSyncData(pollResult.token, pollResult.user.id, updatedConfig);
|
|
114
119
|
return null;
|
|
115
120
|
}
|
|
116
121
|
if (pollResult.status === "expired") {
|
|
@@ -123,6 +128,57 @@ async function login(ctx) {
|
|
|
123
128
|
console.log(chalk.red("Authorization timed out. Please try again."));
|
|
124
129
|
return null;
|
|
125
130
|
}
|
|
131
|
+
async function checkAndRestoreSyncData(token, userId, config) {
|
|
132
|
+
try {
|
|
133
|
+
const syncService = createSyncService({
|
|
134
|
+
authToken: token,
|
|
135
|
+
userId,
|
|
136
|
+
config: {
|
|
137
|
+
...DEFAULT_SYNC_CONFIG,
|
|
138
|
+
...config.sync,
|
|
139
|
+
enabled: true
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const { getSyncApiClient } = await import("./SyncApiClient-FAOMIZAP.js");
|
|
143
|
+
const apiClient = getSyncApiClient();
|
|
144
|
+
const remoteManifest = await apiClient.getRemoteManifest(token);
|
|
145
|
+
if (!remoteManifest || remoteManifest.files.length === 0) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
const fileCount = remoteManifest.files.length;
|
|
149
|
+
const totalSize = remoteManifest.files.reduce((sum, f) => sum + f.size, 0);
|
|
150
|
+
const sizeStr = formatSize(totalSize);
|
|
151
|
+
console.log(chalk.cyan(`Found cloud sync data (${fileCount} files, ${sizeStr})`));
|
|
152
|
+
console.log(chalk.gray("This includes your settings, agents, skills, and memory."));
|
|
153
|
+
console.log();
|
|
154
|
+
const result = await safePrompt({
|
|
155
|
+
type: "confirm",
|
|
156
|
+
name: "restore",
|
|
157
|
+
message: "Would you like to restore your settings from the cloud?",
|
|
158
|
+
initial: true
|
|
159
|
+
});
|
|
160
|
+
if (!result || !result.restore) {
|
|
161
|
+
console.log(chalk.gray("Skipped sync restore. You can sync later with /sync."));
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
console.log(chalk.gray("Restoring settings from cloud..."));
|
|
165
|
+
const syncResult = await syncService.forceDownload();
|
|
166
|
+
if (syncResult.success) {
|
|
167
|
+
console.log(chalk.green(`Restored ${syncResult.downloaded} files from cloud.`));
|
|
168
|
+
} else {
|
|
169
|
+
console.log(chalk.yellow(`Sync restore failed: ${syncResult.error}`));
|
|
170
|
+
console.log(chalk.gray("You can try again later with /sync."));
|
|
171
|
+
}
|
|
172
|
+
} catch (error) {
|
|
173
|
+
console.log(chalk.gray("Could not check cloud sync data."));
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
function formatSize(bytes) {
|
|
177
|
+
if (bytes === 0) return "0 B";
|
|
178
|
+
if (bytes < 1024) return `${bytes} B`;
|
|
179
|
+
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;
|
|
180
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
181
|
+
}
|
|
126
182
|
|
|
127
183
|
export {
|
|
128
184
|
metadata,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkPMMSDR44cjs = require('./chunk-PMMSDR44.cjs');
|
|
4
4
|
|
|
5
5
|
// src/ui/theme/Theme.ts
|
|
6
6
|
var Theme = class {
|
|
@@ -881,9 +881,9 @@ var ThemeContext = _react.createContext.call(void 0, defaultContextValue);
|
|
|
881
881
|
var _fsextra = require('fs-extra'); var _fsextra2 = _interopRequireDefault(_fsextra);
|
|
882
882
|
|
|
883
883
|
var _yaml = require('yaml'); var _yaml2 = _interopRequireDefault(_yaml);
|
|
884
|
-
var DEFAULT_CONFIG_PATH =
|
|
885
|
-
var YAML_CONFIG_PATH =
|
|
886
|
-
var YML_CONFIG_PATH =
|
|
884
|
+
var DEFAULT_CONFIG_PATH = _chunkPMMSDR44cjs.AUTOHAND_FILES.configJson;
|
|
885
|
+
var YAML_CONFIG_PATH = _chunkPMMSDR44cjs.AUTOHAND_FILES.configYaml;
|
|
886
|
+
var YML_CONFIG_PATH = _chunkPMMSDR44cjs.AUTOHAND_FILES.configYml;
|
|
887
887
|
var DEFAULT_BASE_URL = "https://openrouter.ai/api/v1";
|
|
888
888
|
var DEFAULT_OLLAMA_URL = "http://localhost:11434";
|
|
889
889
|
var DEFAULT_LLAMACPP_URL = "http://localhost:8080";
|