autohand-cli 0.7.8 → 0.7.9
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/CommunitySkillsCache-N2RWBCY2.cjs +7 -0
- package/dist/{CommunitySkillsCache-Q22FUAR5.js → CommunitySkillsCache-YWDFZBKP.js} +2 -2
- package/dist/MemoryManager-J7APSLZ7.js +7 -0
- package/dist/MemoryManager-RLLYVIDY.cjs +7 -0
- package/dist/PermissionManager-ISI5OAJK.cjs +10 -0
- package/dist/{PermissionManager-HATZKTRC.js → PermissionManager-WYP5JPCQ.js} +3 -3
- package/dist/SessionManager-7MF76Q3Q.cjs +9 -0
- package/dist/{SessionManager-S5R6O3NU.js → SessionManager-SFBDIBGA.js} +2 -2
- package/dist/{SkillsRegistry-R5WDM6T3.js → SkillsRegistry-E437FFJV.js} +2 -2
- package/dist/SkillsRegistry-UTK2YT4M.cjs +8 -0
- package/dist/{SyncApiClient-FAOMIZAP.js → SyncApiClient-AYXYSOJM.js} +1 -1
- package/dist/SyncApiClient-ID3KXEMA.cjs +10 -0
- package/dist/agents-N2ZB4O2A.cjs +9 -0
- package/dist/{agents-ICAC3KD3.js → agents-ZMT7HBRT.js} +2 -2
- package/dist/agents-new-3EWS2NR3.cjs +11 -0
- package/dist/agents-new-TCGUYK5I.js +11 -0
- package/dist/cc-2W6M7J45.cjs +8 -0
- package/dist/cc-UTTLESTY.js +8 -0
- package/dist/{chunk-XFPITUFJ.cjs → chunk-32R47CAQ.cjs} +50 -8
- package/dist/{chunk-2JPUEN44.cjs → chunk-3DGR4GNN.cjs} +57 -84
- package/dist/{chunk-WIUGUR5T.js → chunk-3DVEGFBZ.js} +8 -8
- package/dist/{chunk-YWKZF2SA.js → chunk-3SDEZTZD.js} +46 -46
- package/dist/{chunk-KH7BCZJN.js → chunk-4BZ65NIH.js} +1 -1
- package/dist/{chunk-52MLYK5P.js → chunk-4YQ2OJAL.js} +1 -1
- package/dist/{chunk-54GVL2SE.cjs → chunk-5UC3VAJ2.cjs} +2 -2
- package/dist/{chunk-YDOR2OCA.cjs → chunk-6DSJ7XST.cjs} +16 -11
- package/dist/chunk-6SM6N7DJ.js +2828 -0
- package/dist/{chunk-MDWULS57.js → chunk-6UJMCWRY.js} +56 -33
- package/dist/{chunk-6KMAJTU3.js → chunk-7GJR65DQ.js} +2 -2
- package/dist/{chunk-B5N5UAMO.cjs → chunk-7WKEDH3E.cjs} +5 -5
- package/dist/{chunk-B4ZPNXZE.cjs → chunk-A5KU3JZW.cjs} +1 -1
- package/dist/{chunk-PMMSDR44.cjs → chunk-AQNY2M6Q.cjs} +3 -1
- package/dist/{chunk-AVL4DKQO.js → chunk-BTVNRLSE.js} +1 -1
- package/dist/{chunk-PU534KPO.cjs → chunk-CHVXUA3O.cjs} +4 -4
- package/dist/{chunk-DPJ3IIBB.js → chunk-CMNQAF6C.js} +7 -2
- package/dist/{chunk-7TOHYAUF.cjs → chunk-CPO5KEQS.cjs} +2 -2
- package/dist/{chunk-5MDDOGTD.cjs → chunk-DRXFJR7F.cjs} +22 -30
- package/dist/{chunk-JBKP2CLA.cjs → chunk-FN5S5OE7.cjs} +47 -47
- package/dist/{chunk-SFGJQPGC.cjs → chunk-FPHU2ES6.cjs} +56 -33
- package/dist/{chunk-3L76MLO5.cjs → chunk-FSTLJIR5.cjs} +21 -28
- package/dist/chunk-HF65HHDU.cjs +83 -0
- package/dist/{chunk-A552JHUJ.cjs → chunk-HUA44A35.cjs} +21 -18
- package/dist/{chunk-B7EUETGY.cjs → chunk-HWDP4HQO.cjs} +4 -4
- package/dist/{chunk-OC5YDNFC.js → chunk-IYZBLUEJ.js} +35 -52
- package/dist/chunk-J2RUI7GJ.js +83 -0
- package/dist/{chunk-WH3D42BQ.js → chunk-J7VV7JAB.js} +55 -82
- package/dist/{chunk-VEDIYPWY.cjs → chunk-JRV4SOJU.cjs} +9 -9
- package/dist/{chunk-GWIAMKKF.js → chunk-K6CZ2AGI.js} +6 -3
- package/dist/{chunk-SYJLMBLP.cjs → chunk-KJAZ4YAR.cjs} +17 -17
- package/dist/{chunk-BAFJQUWR.js → chunk-KS45GREN.js} +12 -19
- package/dist/chunk-KXNAGJE6.cjs +589 -0
- package/dist/chunk-L5QWMGLV.cjs +2828 -0
- package/dist/{chunk-U5WIP4HS.js → chunk-LCBOOA7S.js} +47 -5
- package/dist/chunk-LJCSSR5V.cjs +63 -0
- package/dist/chunk-LKIKNRUP.js +219 -0
- package/dist/{chunk-WQSWU2QA.cjs → chunk-LY5VN3B3.cjs} +9 -6
- package/dist/{chunk-YAGD43KA.cjs → chunk-LYMZDJX5.cjs} +36 -37
- package/dist/{chunk-SLISYSP4.cjs → chunk-MRDZHNCF.cjs} +4 -4
- package/dist/chunk-NCC6ETZS.js +362 -0
- package/dist/chunk-NCLCL7JK.js +63 -0
- package/dist/chunk-NTFNUTY2.js +589 -0
- package/dist/{chunk-GDTZQSJ6.cjs → chunk-O3EX3SAD.cjs} +2 -2
- package/dist/chunk-OO7EKEJH.cjs +219 -0
- package/dist/{chunk-P2Z6GDEN.js → chunk-OXJCLU3X.js} +1 -1
- package/dist/{chunk-23JQSCTO.js → chunk-P6EGMTK4.js} +1 -1
- package/dist/{chunk-VPAN5H7Q.js → chunk-PFS5ZOCO.js} +30 -31
- package/dist/{chunk-EKY5PKQI.js → chunk-PGH3MHPP.js} +3 -1
- package/dist/{chunk-EDGV5BNH.js → chunk-PVSYZXS7.js} +18 -26
- package/dist/{chunk-NI3BQXKU.js → chunk-QAJM6VG5.js} +2 -2
- package/dist/{chunk-OBV3UUIL.js → chunk-R5PZPF55.js} +1 -1
- package/dist/{chunk-MJFBVQHB.js → chunk-RDGYHJ52.js} +5 -5
- package/dist/{chunk-YDH2BMEN.js → chunk-RX4KPL6H.js} +1 -1
- package/dist/{chunk-GFJ6AETU.cjs → chunk-T7HQBZZB.cjs} +6 -6
- package/dist/chunk-TSV4LVHK.js +35 -0
- package/dist/{chunk-7VW3A7DO.cjs → chunk-TUO5SZRD.cjs} +2 -2
- package/dist/{chunk-C3IFF3EH.cjs → chunk-UL5T2XIY.cjs} +36 -53
- package/dist/chunk-ULQ6MDSJ.cjs +362 -0
- package/dist/{chunk-UL7YPRCU.js → chunk-UP6YRP44.js} +1 -1
- package/dist/{chunk-G77ZY4QG.js → chunk-VQDWNDP5.js} +1 -1
- package/dist/chunk-VXCMGBXY.cjs +35 -0
- package/dist/{chunk-JHFH3N4U.cjs → chunk-WCN5WDOI.cjs} +2 -2
- package/dist/{chunk-53BR4MUW.cjs → chunk-WGO4ACS7.cjs} +3 -3
- package/dist/{chunk-4M2GX7RH.cjs → chunk-WJICM4SK.cjs} +2 -2
- package/dist/{chunk-4RWTUT2Z.js → chunk-WT367RVU.js} +19 -16
- package/dist/{chunk-A6QBABQ7.js → chunk-XOSFZHSS.js} +2 -2
- package/dist/{chunk-3YEDXG6S.js → chunk-YDJA5ETO.js} +1 -1
- package/dist/completion-NCSTSKTL.cjs +11 -0
- package/dist/{completion-Y42FKDT3.js → completion-NTZERPAZ.js} +2 -1
- package/dist/constants-B2X7KDIH.cjs +20 -0
- package/dist/{constants-ZLG6M5SI.js → constants-OFIAR4E5.js} +1 -1
- package/dist/export-5AJNVX4O.cjs +9 -0
- package/dist/{export-WJ5P6E5Z.js → export-ZQHTLV4W.js} +2 -1
- package/dist/feedback-F7BMGSV6.cjs +12 -0
- package/dist/feedback-NL7CWTRY.js +12 -0
- package/dist/hooks-AX5VPCZ3.cjs +10 -0
- package/dist/hooks-V22HVLQT.js +10 -0
- package/dist/index.cjs +5306 -3582
- package/dist/index.js +3780 -2056
- package/dist/language-IEKARNQH.js +13 -0
- package/dist/language-ULQCKXAD.cjs +13 -0
- package/dist/localProjectPermissions-7FI3XF4K.cjs +17 -0
- package/dist/{localProjectPermissions-YFFAKLUZ.js → localProjectPermissions-FD5AK5FB.js} +2 -2
- package/dist/login-PD3DFJLM.js +15 -0
- package/dist/login-VHGT4YKT.cjs +15 -0
- package/dist/logout-2QXNFGDT.js +13 -0
- package/dist/logout-A4SMKEFO.cjs +13 -0
- package/dist/permissions-S7433NQJ.js +10 -0
- package/dist/permissions-YZ6WCDBL.cjs +10 -0
- package/dist/plan-B3CW5DXJ.cjs +10 -0
- package/dist/plan-JFGNRL2S.js +10 -0
- package/dist/resume-54ERVSFM.cjs +10 -0
- package/dist/resume-YJ5CVKAP.js +10 -0
- package/dist/search-4TEQMUPU.js +11 -0
- package/dist/search-QGLS4SV7.cjs +11 -0
- package/dist/share-2B2T3AUU.cjs +11 -0
- package/dist/share-SZMXZIA3.js +11 -0
- package/dist/skills-HVQNCTGK.cjs +12 -0
- package/dist/{skills-3YEEODHK.js → skills-PB4HXV4R.js} +1 -1
- package/dist/{skills-install-FTGOHOZ4.cjs → skills-install-7SFS24HY.cjs} +10 -9
- package/dist/{skills-install-KAXAQSN6.js → skills-install-UBBNXWD5.js} +4 -3
- package/dist/skills-new-5FSDAJWE.js +12 -0
- package/dist/skills-new-IOTZYE6F.cjs +12 -0
- package/dist/{status-PBFFUC4Q.js → status-AGPSKXSW.js} +2 -2
- package/dist/status-WOINF556.cjs +9 -0
- package/dist/{sync-3B7SNBYC.js → sync-64MZDWGG.js} +3 -3
- package/dist/sync-F5ECJW25.cjs +39 -0
- package/dist/{sync-H4UHHLKU.js → sync-LYKDHRFM.js} +3 -3
- package/dist/sync-W5UR7BEP.cjs +14 -0
- package/dist/theme-CWG3ZLHB.cjs +13 -0
- package/dist/theme-HQKV7YAP.js +13 -0
- package/package.json +2 -2
- package/dist/CommunitySkillsCache-2BITCEAA.cjs +0 -7
- package/dist/MemoryManager-2ATHG7BH.js +0 -7
- package/dist/MemoryManager-AENCGCEW.cjs +0 -7
- package/dist/PermissionManager-6HZGTK2N.cjs +0 -10
- package/dist/SessionManager-AG4WT3DP.cjs +0 -9
- package/dist/SkillsRegistry-ZXU6YDRP.cjs +0 -8
- package/dist/SyncApiClient-UOA4VLLD.cjs +0 -10
- package/dist/agents-YONWPKFS.cjs +0 -9
- package/dist/agents-new-NV557UVG.cjs +0 -10
- package/dist/agents-new-QHM3CO4B.js +0 -10
- package/dist/chunk-3HPUOQJN.cjs +0 -23
- package/dist/chunk-5DN5KNXU.js +0 -81
- package/dist/chunk-7BYSXAKS.js +0 -23
- package/dist/chunk-ARVFUZOB.js +0 -736
- package/dist/chunk-GWXXFQ3F.cjs +0 -81
- package/dist/chunk-XFQS2VGT.cjs +0 -736
- package/dist/completion-WVFWX7XQ.cjs +0 -10
- package/dist/constants-G2PLP5HH.cjs +0 -20
- package/dist/export-BKBJ7PB2.cjs +0 -8
- package/dist/feedback-HZBCTSFG.js +0 -10
- package/dist/feedback-JBQ3UPGZ.cjs +0 -10
- package/dist/hooks-G4VLYMLX.cjs +0 -9
- package/dist/hooks-LN4A6NQL.js +0 -9
- package/dist/language-KODBDE5R.js +0 -12
- package/dist/language-SJT475NW.cjs +0 -12
- package/dist/localProjectPermissions-AYQYGTOE.cjs +0 -17
- package/dist/login-TC2KROQI.js +0 -14
- package/dist/login-TYMR2ZD3.cjs +0 -14
- package/dist/logout-2ECV365P.js +0 -12
- package/dist/logout-CO3CPYZJ.cjs +0 -12
- package/dist/permissions-5MTH22EF.js +0 -9
- package/dist/permissions-IP5SITPI.cjs +0 -9
- package/dist/resume-EPOEF3WV.cjs +0 -9
- package/dist/resume-LOYD5MMP.js +0 -9
- package/dist/share-APR5S2CS.cjs +0 -10
- package/dist/share-VLJFDZKR.js +0 -10
- package/dist/skills-CRM55MKM.cjs +0 -12
- package/dist/skills-new-JF4FKNUT.cjs +0 -11
- package/dist/skills-new-JYX2GBKM.js +0 -11
- package/dist/status-DAEFE7ZC.cjs +0 -9
- package/dist/sync-4RARBQIH.cjs +0 -39
- package/dist/sync-YZ6YZ42H.cjs +0 -14
- package/dist/theme-3XV5BWUB.js +0 -12
- package/dist/theme-Z2WS5XWZ.cjs +0 -12
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkHWDP4HQOcjs = require('./chunk-HWDP4HQO.cjs');
|
|
5
|
+
require('./chunk-CPO5KEQS.cjs');
|
|
6
|
+
require('./chunk-AQNY2M6Q.cjs');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.DEFAULT_SECURITY_BLACKLIST = _chunkHWDP4HQOcjs.DEFAULT_SECURITY_BLACKLIST; exports.PermissionManager = _chunkHWDP4HQOcjs.PermissionManager;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SECURITY_BLACKLIST,
|
|
3
3
|
PermissionManager
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-VQDWNDP5.js";
|
|
5
|
+
import "./chunk-OXJCLU3X.js";
|
|
6
|
+
import "./chunk-PGH3MHPP.js";
|
|
7
7
|
export {
|
|
8
8
|
DEFAULT_SECURITY_BLACKLIST,
|
|
9
9
|
PermissionManager
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkTUO5SZRDcjs = require('./chunk-TUO5SZRD.cjs');
|
|
5
|
+
require('./chunk-AQNY2M6Q.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.Session = _chunkTUO5SZRDcjs.Session; exports.SessionManager = _chunkTUO5SZRDcjs.SessionManager;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
var _chunkWGO4ACS7cjs = require('./chunk-WGO4ACS7.cjs');
|
|
4
|
+
require('./chunk-JHGIWNHL.cjs');
|
|
5
|
+
require('./chunk-AQNY2M6Q.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.SkillsRegistry = _chunkWGO4ACS7cjs.SkillsRegistry;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
var _chunkFPHU2ES6cjs = require('./chunk-FPHU2ES6.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.SyncApiClient = _chunkFPHU2ES6cjs.SyncApiClient; exports.getSyncApiClient = _chunkFPHU2ES6cjs.getSyncApiClient; exports.resetSyncApiClient = _chunkFPHU2ES6cjs.resetSyncApiClient;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkWJICM4SKcjs = require('./chunk-WJICM4SK.cjs');
|
|
5
|
+
require('./chunk-AQNY2M6Q.cjs');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.handler = _chunkWJICM4SKcjs.handler; exports.metadata = _chunkWJICM4SKcjs.metadata;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkMRDZHNCFcjs = require('./chunk-MRDZHNCF.cjs');
|
|
5
|
+
require('./chunk-LJCSSR5V.cjs');
|
|
6
|
+
require('./chunk-L5QWMGLV.cjs');
|
|
7
|
+
require('./chunk-AQNY2M6Q.cjs');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
exports.createAgent = _chunkMRDZHNCFcjs.createAgent; exports.metadata = _chunkMRDZHNCFcjs.metadata;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } 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 _chunkFPHU2ES6cjs = require('./chunk-FPHU2ES6.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
var
|
|
6
|
+
var _chunkAQNY2M6Qcjs = require('./chunk-AQNY2M6Q.cjs');
|
|
7
7
|
|
|
8
8
|
// src/sync/types.ts
|
|
9
9
|
var DEFAULT_SYNC_CONFIG = {
|
|
@@ -165,13 +165,15 @@ var SyncService = class {
|
|
|
165
165
|
this.timer = null;
|
|
166
166
|
this.syncing = false;
|
|
167
167
|
this.started = false;
|
|
168
|
+
this.authFailed = false;
|
|
168
169
|
this.authToken = options.authToken;
|
|
169
170
|
this.userId = options.userId;
|
|
170
171
|
this.config = options.config;
|
|
171
|
-
this.client = options.apiClient ||
|
|
172
|
+
this.client = options.apiClient || _chunkFPHU2ES6cjs.getSyncApiClient.call(void 0, );
|
|
172
173
|
this.onEvent = options.onEvent || (() => {
|
|
173
174
|
});
|
|
174
|
-
this.
|
|
175
|
+
this.onAuthFailure = options.onAuthFailure;
|
|
176
|
+
this.basePath = _chunkAQNY2M6Qcjs.AUTOHAND_HOME;
|
|
175
177
|
}
|
|
176
178
|
/**
|
|
177
179
|
* Start the background sync timer
|
|
@@ -179,9 +181,13 @@ var SyncService = class {
|
|
|
179
181
|
start() {
|
|
180
182
|
if (this.started) return;
|
|
181
183
|
this.started = true;
|
|
182
|
-
this.sync().
|
|
184
|
+
this.sync().then((result) => {
|
|
185
|
+
if (!result.success && this.isAuthError(result.error)) {
|
|
186
|
+
}
|
|
187
|
+
}).catch(() => {
|
|
183
188
|
});
|
|
184
189
|
this.timer = setInterval(() => {
|
|
190
|
+
if (this.authFailed) return;
|
|
185
191
|
this.sync().catch(() => {
|
|
186
192
|
});
|
|
187
193
|
}, this.config.interval);
|
|
@@ -279,7 +285,11 @@ var SyncService = class {
|
|
|
279
285
|
this.onEvent({ type: "conflict_resolved", path: file.path, strategy: "cloud_wins" });
|
|
280
286
|
}
|
|
281
287
|
} catch (error) {
|
|
282
|
-
|
|
288
|
+
const errorMsg = error.message;
|
|
289
|
+
if (this.isAuthError(errorMsg)) {
|
|
290
|
+
throw error;
|
|
291
|
+
}
|
|
292
|
+
this.onEvent({ type: "download_error", path: file.path, error: errorMsg });
|
|
283
293
|
}
|
|
284
294
|
}
|
|
285
295
|
for (const filePath of actions.localDeletes) {
|
|
@@ -311,7 +321,11 @@ var SyncService = class {
|
|
|
311
321
|
uploaded++;
|
|
312
322
|
this.onEvent({ type: "file_uploaded", path: file.path, size: content.length });
|
|
313
323
|
} catch (error) {
|
|
314
|
-
|
|
324
|
+
const errorMsg = error.message;
|
|
325
|
+
if (this.isAuthError(errorMsg)) {
|
|
326
|
+
throw error;
|
|
327
|
+
}
|
|
328
|
+
this.onEvent({ type: "upload_error", path: file.path, error: errorMsg });
|
|
315
329
|
}
|
|
316
330
|
}
|
|
317
331
|
await this.client.completeUpload(this.authToken, localManifest);
|
|
@@ -333,6 +347,17 @@ var SyncService = class {
|
|
|
333
347
|
return result;
|
|
334
348
|
} catch (error) {
|
|
335
349
|
const errorMessage = error.message;
|
|
350
|
+
if (this.isAuthError(errorMessage)) {
|
|
351
|
+
this.handleAuthFailure(errorMessage);
|
|
352
|
+
return {
|
|
353
|
+
success: false,
|
|
354
|
+
uploaded: 0,
|
|
355
|
+
downloaded: 0,
|
|
356
|
+
conflicts: 0,
|
|
357
|
+
error: "Authentication expired. Please run /login again.",
|
|
358
|
+
duration: Date.now() - startTime
|
|
359
|
+
};
|
|
360
|
+
}
|
|
336
361
|
this.onEvent({ type: "sync_failed", error: errorMessage });
|
|
337
362
|
return {
|
|
338
363
|
success: false,
|
|
@@ -348,6 +373,23 @@ var SyncService = class {
|
|
|
348
373
|
});
|
|
349
374
|
}
|
|
350
375
|
}
|
|
376
|
+
/**
|
|
377
|
+
* Check if an error message indicates an authentication failure
|
|
378
|
+
*/
|
|
379
|
+
isAuthError(errorMessage) {
|
|
380
|
+
if (!errorMessage) return false;
|
|
381
|
+
return errorMessage.includes("401") || errorMessage.toLowerCase().includes("unauthorized") || errorMessage.toLowerCase().includes("authentication");
|
|
382
|
+
}
|
|
383
|
+
/**
|
|
384
|
+
* Handle authentication failure - stop service and notify
|
|
385
|
+
*/
|
|
386
|
+
handleAuthFailure(errorMessage) {
|
|
387
|
+
if (this.authFailed) return;
|
|
388
|
+
this.authFailed = true;
|
|
389
|
+
this.stop();
|
|
390
|
+
this.onEvent({ type: "auth_failure", error: errorMessage });
|
|
391
|
+
_optionalChain([this, 'access', _ => _.onAuthFailure, 'optionalCall', _2 => _2()]);
|
|
392
|
+
}
|
|
351
393
|
/**
|
|
352
394
|
* Build manifest from local ~/.autohand/ files
|
|
353
395
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
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
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkLY5VN3B3cjs = require('./chunk-LY5VN3B3.cjs');
|
|
5
5
|
|
|
6
6
|
// src/commands/sync.ts
|
|
7
7
|
var _chalk = require('chalk'); var _chalk2 = _interopRequireDefault(_chalk);
|
|
@@ -19,7 +19,7 @@ function getSyncService() {
|
|
|
19
19
|
return globalSyncService;
|
|
20
20
|
}
|
|
21
21
|
async function sync(ctx) {
|
|
22
|
-
const config = await
|
|
22
|
+
const config = await _chunkLY5VN3B3cjs.loadConfig.call(void 0, );
|
|
23
23
|
const isLoggedIn = Boolean(_optionalChain([config, 'access', _ => _.auth, 'optionalAccess', _2 => _2.token]) && _optionalChain([config, 'access', _3 => _3.auth, 'optionalAccess', _4 => _4.user]));
|
|
24
24
|
if (!isLoggedIn) {
|
|
25
25
|
console.log(_chalk2.default.yellow("\nSettings sync requires authentication."));
|
|
@@ -85,94 +85,67 @@ function renderSyncUI(data, ctx) {
|
|
|
85
85
|
renderTabContent(tabs[currentTab], data);
|
|
86
86
|
console.log(_chalk2.default.gray("\nEsc to exit | Tab to cycle | s: sync now | e: toggle enabled"));
|
|
87
87
|
};
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
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()) {
|
|
88
|
+
const handler = async (_str, key) => {
|
|
89
|
+
const char = (_str || "").toLowerCase();
|
|
90
|
+
if (key.name === "escape" || key.name === "c" && key.ctrl) {
|
|
91
|
+
cleanup();
|
|
92
|
+
resolve();
|
|
93
|
+
return;
|
|
112
94
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
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(_chalk2.default.cyan("\nSyncing..."));
|
|
138
|
-
try {
|
|
139
|
-
const result = await data.syncService.sync();
|
|
140
|
-
if (result.success) {
|
|
141
|
-
console.log(_chalk2.default.green(`Sync complete! Uploaded: ${result.uploaded}, Downloaded: ${result.downloaded}`));
|
|
142
|
-
} else {
|
|
143
|
-
console.log(_chalk2.default.red(`Sync failed: ${result.error}`));
|
|
144
|
-
}
|
|
145
|
-
const config = await _chunkWQSWU2QAcjs.loadConfig.call(void 0, );
|
|
146
|
-
Object.assign(data, await gatherSyncData(ctx, config));
|
|
147
|
-
} catch (err) {
|
|
148
|
-
console.log(_chalk2.default.red(`Sync error: ${err}`));
|
|
149
|
-
}
|
|
150
|
-
await sleep(1500);
|
|
151
|
-
render();
|
|
152
|
-
}
|
|
153
|
-
return;
|
|
154
|
-
case "e":
|
|
155
|
-
case "E":
|
|
95
|
+
if (key.name === "tab" && key.shift) {
|
|
96
|
+
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
97
|
+
render();
|
|
98
|
+
return;
|
|
99
|
+
}
|
|
100
|
+
if (key.name === "tab" || key.name === "right") {
|
|
101
|
+
currentTab = (currentTab + 1) % tabs.length;
|
|
102
|
+
render();
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
if (key.name === "left") {
|
|
106
|
+
currentTab = (currentTab - 1 + tabs.length) % tabs.length;
|
|
107
|
+
render();
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
if (char === "s") {
|
|
111
|
+
if (data.syncService) {
|
|
112
|
+
console.log(_chalk2.default.cyan("\nSyncing..."));
|
|
156
113
|
try {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
await
|
|
165
|
-
render();
|
|
114
|
+
const result = await data.syncService.sync();
|
|
115
|
+
if (result.success) {
|
|
116
|
+
console.log(_chalk2.default.green(`Sync complete! Uploaded: ${result.uploaded}, Downloaded: ${result.downloaded}`));
|
|
117
|
+
} else {
|
|
118
|
+
console.log(_chalk2.default.red(`Sync failed: ${result.error}`));
|
|
119
|
+
}
|
|
120
|
+
const config = await _chunkLY5VN3B3cjs.loadConfig.call(void 0, );
|
|
121
|
+
Object.assign(data, await gatherSyncData(ctx, config));
|
|
166
122
|
} catch (err) {
|
|
167
|
-
console.log(_chalk2.default.red(`
|
|
123
|
+
console.log(_chalk2.default.red(`Sync error: ${err}`));
|
|
168
124
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
125
|
+
await sleep(1500);
|
|
126
|
+
render();
|
|
127
|
+
}
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
if (char === "e") {
|
|
131
|
+
try {
|
|
132
|
+
const config = await _chunkLY5VN3B3cjs.loadConfig.call(void 0, );
|
|
133
|
+
const newEnabled = _optionalChain([config, 'access', _16 => _16.sync, 'optionalAccess', _17 => _17.enabled]) === false;
|
|
134
|
+
config.sync = { ...config.sync, enabled: newEnabled };
|
|
135
|
+
await _chunkLY5VN3B3cjs.saveConfig.call(void 0, config);
|
|
136
|
+
data.enabled = newEnabled;
|
|
137
|
+
console.log(_chalk2.default.cyan(`
|
|
138
|
+
Sync ${newEnabled ? "enabled" : "disabled"}`));
|
|
139
|
+
await sleep(1e3);
|
|
140
|
+
render();
|
|
141
|
+
} catch (err) {
|
|
142
|
+
console.log(_chalk2.default.red(`Error toggling sync: ${err}`));
|
|
143
|
+
}
|
|
144
|
+
return;
|
|
172
145
|
}
|
|
173
146
|
};
|
|
174
147
|
const cleanup = () => {
|
|
175
|
-
input.off("
|
|
148
|
+
input.off("keypress", handler);
|
|
176
149
|
if (isTTY && !wasRaw && typeof input.setRawMode === "function") {
|
|
177
150
|
input.setRawMode(false);
|
|
178
151
|
}
|
|
@@ -181,7 +154,7 @@ Sync ${newEnabled ? "enabled" : "disabled"}`));
|
|
|
181
154
|
}
|
|
182
155
|
process.stdout.write("\x1B[2J\x1B[H");
|
|
183
156
|
};
|
|
184
|
-
input.on("
|
|
157
|
+
input.on("keypress", handler);
|
|
185
158
|
render();
|
|
186
159
|
});
|
|
187
160
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DEFAULT_SYNC_CONFIG,
|
|
3
3
|
createSyncService
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-LCBOOA7S.js";
|
|
5
5
|
import {
|
|
6
6
|
getAuthClient
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
saveConfig
|
|
10
|
-
} from "./chunk-GWIAMKKF.js";
|
|
7
|
+
} from "./chunk-4YQ2OJAL.js";
|
|
11
8
|
import {
|
|
12
9
|
safePrompt
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-NCLCL7JK.js";
|
|
11
|
+
import {
|
|
12
|
+
saveConfig
|
|
13
|
+
} from "./chunk-K6CZ2AGI.js";
|
|
14
14
|
import {
|
|
15
15
|
AUTH_CONFIG
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-PGH3MHPP.js";
|
|
17
17
|
|
|
18
18
|
// src/commands/login.ts
|
|
19
19
|
import chalk from "chalk";
|
|
@@ -139,7 +139,7 @@ async function checkAndRestoreSyncData(token, userId, config) {
|
|
|
139
139
|
enabled: true
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
const { getSyncApiClient } = await import("./SyncApiClient-
|
|
142
|
+
const { getSyncApiClient } = await import("./SyncApiClient-AYXYSOJM.js");
|
|
143
143
|
const apiClient = getSyncApiClient();
|
|
144
144
|
const remoteManifest = await apiClient.getRemoteManifest(token);
|
|
145
145
|
if (!remoteManifest || remoteManifest.files.length === 0) {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import {
|
|
2
|
+
showModal
|
|
3
|
+
} from "./chunk-6SM6N7DJ.js";
|
|
4
|
+
|
|
1
5
|
// src/commands/completion.ts
|
|
2
6
|
import chalk2 from "chalk";
|
|
3
|
-
import enquirer from "enquirer";
|
|
4
7
|
|
|
5
8
|
// src/completions/index.ts
|
|
6
9
|
import fs from "fs-extra";
|
|
@@ -276,58 +279,55 @@ async function execute(args) {
|
|
|
276
279
|
if (detected) {
|
|
277
280
|
console.log(chalk2.gray(`Detected shell: ${detected}`));
|
|
278
281
|
}
|
|
279
|
-
const
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
initial: detected || "bash"
|
|
282
|
+
const shellOptions = [
|
|
283
|
+
{ label: "Bash", value: "bash" },
|
|
284
|
+
{ label: "Zsh", value: "zsh" },
|
|
285
|
+
{ label: "Fish", value: "fish" }
|
|
286
|
+
];
|
|
287
|
+
const shellResult = await showModal({
|
|
288
|
+
title: "Select your shell:",
|
|
289
|
+
options: shellOptions,
|
|
290
|
+
initialIndex: shellOptions.findIndex((o) => o.value === (detected || "bash"))
|
|
289
291
|
});
|
|
290
|
-
|
|
291
|
-
shell = await prompt.run();
|
|
292
|
-
} catch {
|
|
292
|
+
if (!shellResult) {
|
|
293
293
|
console.log(chalk2.gray("Cancelled."));
|
|
294
294
|
return;
|
|
295
295
|
}
|
|
296
|
+
shell = shellResult.value;
|
|
296
297
|
}
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
]
|
|
298
|
+
const actionOptions = [
|
|
299
|
+
{ label: "Print completion script to terminal", value: "print" },
|
|
300
|
+
{ label: "Install completion to default location", value: "install" },
|
|
301
|
+
{ label: "Show installation instructions", value: "instructions" }
|
|
302
|
+
];
|
|
303
|
+
const actionResult = await showModal({
|
|
304
|
+
title: "What would you like to do?",
|
|
305
|
+
options: actionOptions
|
|
306
306
|
});
|
|
307
|
-
|
|
308
|
-
const action = await actionPrompt.run();
|
|
309
|
-
switch (action) {
|
|
310
|
-
case "print":
|
|
311
|
-
console.log();
|
|
312
|
-
console.log(chalk2.cyan(`# ${shell} completion script for autohand`));
|
|
313
|
-
console.log(chalk2.cyan("# Copy and save to appropriate location"));
|
|
314
|
-
console.log();
|
|
315
|
-
console.log(generateCompletion(shell));
|
|
316
|
-
break;
|
|
317
|
-
case "install":
|
|
318
|
-
const installPath = await installCompletion(shell);
|
|
319
|
-
console.log();
|
|
320
|
-
console.log(chalk2.green("Completion script installed to:"));
|
|
321
|
-
console.log(chalk2.cyan(` ${installPath}`));
|
|
322
|
-
console.log();
|
|
323
|
-
console.log(getInstallInstructions(shell));
|
|
324
|
-
break;
|
|
325
|
-
case "instructions":
|
|
326
|
-
console.log(getInstallInstructions(shell));
|
|
327
|
-
break;
|
|
328
|
-
}
|
|
329
|
-
} catch {
|
|
307
|
+
if (!actionResult) {
|
|
330
308
|
console.log(chalk2.gray("Cancelled."));
|
|
309
|
+
return;
|
|
310
|
+
}
|
|
311
|
+
const action = actionResult.value;
|
|
312
|
+
switch (action) {
|
|
313
|
+
case "print":
|
|
314
|
+
console.log();
|
|
315
|
+
console.log(chalk2.cyan(`# ${shell} completion script for autohand`));
|
|
316
|
+
console.log(chalk2.cyan("# Copy and save to appropriate location"));
|
|
317
|
+
console.log();
|
|
318
|
+
console.log(generateCompletion(shell));
|
|
319
|
+
break;
|
|
320
|
+
case "install":
|
|
321
|
+
const installPath = await installCompletion(shell);
|
|
322
|
+
console.log();
|
|
323
|
+
console.log(chalk2.green("Completion script installed to:"));
|
|
324
|
+
console.log(chalk2.cyan(` ${installPath}`));
|
|
325
|
+
console.log();
|
|
326
|
+
console.log(getInstallInstructions(shell));
|
|
327
|
+
break;
|
|
328
|
+
case "instructions":
|
|
329
|
+
console.log(getInstallInstructions(shell));
|
|
330
|
+
break;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
333
|
async function runCompletionCommand(shell) {
|