@kaitranntt/ccs 4.4.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -7
- package/VERSION +1 -1
- package/config/base-agy.settings.json +10 -0
- package/config/base-codex.settings.json +10 -0
- package/config/base-gemini.settings.json +10 -0
- package/dist/auth/auth-commands.d.ts +52 -0
- package/dist/auth/auth-commands.d.ts.map +1 -0
- package/dist/auth/auth-commands.js +479 -0
- package/dist/auth/auth-commands.js.map +1 -0
- package/dist/auth/profile-detector.d.ts +68 -0
- package/dist/auth/profile-detector.d.ts.map +1 -0
- package/dist/auth/profile-detector.js +209 -0
- package/dist/auth/profile-detector.js.map +1 -0
- package/dist/auth/profile-registry.d.ts +60 -0
- package/dist/auth/profile-registry.d.ts.map +1 -0
- package/dist/auth/profile-registry.js +188 -0
- package/dist/auth/profile-registry.js.map +1 -0
- package/dist/ccs.d.ts +10 -0
- package/dist/ccs.d.ts.map +1 -0
- package/dist/ccs.js +320 -0
- package/dist/ccs.js.map +1 -0
- package/dist/cliproxy/auth-handler.d.ts +95 -0
- package/dist/cliproxy/auth-handler.d.ts.map +1 -0
- package/dist/cliproxy/auth-handler.js +443 -0
- package/dist/cliproxy/auth-handler.js.map +1 -0
- package/dist/cliproxy/base-config-loader.d.ts +42 -0
- package/dist/cliproxy/base-config-loader.d.ts.map +1 -0
- package/dist/cliproxy/base-config-loader.js +123 -0
- package/dist/cliproxy/base-config-loader.js.map +1 -0
- package/dist/cliproxy/binary-manager.d.ts +104 -0
- package/dist/cliproxy/binary-manager.d.ts.map +1 -0
- package/dist/cliproxy/binary-manager.js +567 -0
- package/dist/cliproxy/binary-manager.js.map +1 -0
- package/dist/cliproxy/cliproxy-executor.d.ts +33 -0
- package/dist/cliproxy/cliproxy-executor.d.ts.map +1 -0
- package/dist/cliproxy/cliproxy-executor.js +297 -0
- package/dist/cliproxy/cliproxy-executor.js.map +1 -0
- package/dist/cliproxy/config-generator.d.ts +89 -0
- package/dist/cliproxy/config-generator.d.ts.map +1 -0
- package/dist/cliproxy/config-generator.js +263 -0
- package/dist/cliproxy/config-generator.js.map +1 -0
- package/dist/cliproxy/index.d.ts +13 -0
- package/dist/cliproxy/index.d.ts.map +1 -0
- package/dist/cliproxy/index.js +62 -0
- package/dist/cliproxy/index.js.map +1 -0
- package/dist/cliproxy/platform-detector.d.ts +48 -0
- package/dist/cliproxy/platform-detector.d.ts.map +1 -0
- package/dist/cliproxy/platform-detector.js +118 -0
- package/dist/cliproxy/platform-detector.js.map +1 -0
- package/dist/cliproxy/types.d.ts +169 -0
- package/dist/cliproxy/types.d.ts.map +1 -0
- package/dist/cliproxy/types.js +7 -0
- package/dist/cliproxy/types.js.map +1 -0
- package/dist/commands/doctor-command.d.ts +10 -0
- package/dist/commands/doctor-command.d.ts.map +1 -0
- package/dist/commands/doctor-command.js +44 -0
- package/dist/commands/doctor-command.js.map +1 -0
- package/dist/commands/help-command.d.ts +5 -0
- package/dist/commands/help-command.d.ts.map +1 -0
- package/dist/commands/help-command.js +104 -0
- package/dist/commands/help-command.js.map +1 -0
- package/dist/commands/install-command.d.ts +14 -0
- package/dist/commands/install-command.d.ts.map +1 -0
- package/dist/commands/install-command.js +39 -0
- package/dist/commands/install-command.js.map +1 -0
- package/dist/commands/shell-completion-command.d.ts +10 -0
- package/dist/commands/shell-completion-command.d.ts.map +1 -0
- package/dist/commands/shell-completion-command.js +85 -0
- package/dist/commands/shell-completion-command.js.map +1 -0
- package/dist/commands/sync-command.d.ts +10 -0
- package/dist/commands/sync-command.d.ts.map +1 -0
- package/dist/commands/sync-command.js +59 -0
- package/dist/commands/sync-command.js.map +1 -0
- package/dist/commands/update-command.d.ts +12 -0
- package/dist/commands/update-command.d.ts.map +1 -0
- package/dist/commands/update-command.js +295 -0
- package/dist/commands/update-command.js.map +1 -0
- package/dist/commands/version-command.d.ts +10 -0
- package/dist/commands/version-command.d.ts.map +1 -0
- package/dist/commands/version-command.js +100 -0
- package/dist/commands/version-command.js.map +1 -0
- package/dist/delegation/delegation-handler.d.ts +60 -0
- package/dist/delegation/delegation-handler.d.ts.map +1 -0
- package/dist/delegation/delegation-handler.js +174 -0
- package/dist/delegation/delegation-handler.js.map +1 -0
- package/dist/delegation/headless-executor.d.ts +114 -0
- package/dist/delegation/headless-executor.d.ts.map +1 -0
- package/dist/delegation/headless-executor.js +562 -0
- package/dist/delegation/headless-executor.js.map +1 -0
- package/dist/delegation/result-formatter.d.ts +108 -0
- package/dist/delegation/result-formatter.d.ts.map +1 -0
- package/dist/delegation/result-formatter.js +391 -0
- package/dist/delegation/result-formatter.js.map +1 -0
- package/dist/delegation/session-manager.d.ts +58 -0
- package/dist/delegation/session-manager.d.ts.map +1 -0
- package/dist/delegation/session-manager.js +153 -0
- package/dist/delegation/session-manager.js.map +1 -0
- package/dist/delegation/settings-parser.d.ts +31 -0
- package/dist/delegation/settings-parser.d.ts.map +1 -0
- package/dist/delegation/settings-parser.js +107 -0
- package/dist/delegation/settings-parser.js.map +1 -0
- package/dist/glmt/delta-accumulator.d.ts +210 -0
- package/dist/glmt/delta-accumulator.d.ts.map +1 -0
- package/dist/glmt/delta-accumulator.js +351 -0
- package/dist/glmt/delta-accumulator.js.map +1 -0
- package/dist/glmt/glmt-proxy.d.ts +72 -0
- package/dist/glmt/glmt-proxy.d.ts.map +1 -0
- package/dist/glmt/glmt-proxy.js +427 -0
- package/dist/glmt/glmt-proxy.js.map +1 -0
- package/dist/glmt/glmt-transformer.d.ts +265 -0
- package/dist/glmt/glmt-transformer.d.ts.map +1 -0
- package/dist/glmt/glmt-transformer.js +832 -0
- package/dist/glmt/glmt-transformer.js.map +1 -0
- package/dist/glmt/locale-enforcer.d.ts +38 -0
- package/dist/glmt/locale-enforcer.d.ts.map +1 -0
- package/dist/glmt/locale-enforcer.js +69 -0
- package/dist/glmt/locale-enforcer.js.map +1 -0
- package/dist/glmt/reasoning-enforcer.d.ts +52 -0
- package/dist/glmt/reasoning-enforcer.d.ts.map +1 -0
- package/dist/glmt/reasoning-enforcer.js +151 -0
- package/dist/glmt/reasoning-enforcer.js.map +1 -0
- package/dist/glmt/sse-parser.d.ts +47 -0
- package/dist/glmt/sse-parser.d.ts.map +1 -0
- package/dist/glmt/sse-parser.js +93 -0
- package/dist/glmt/sse-parser.js.map +1 -0
- package/dist/management/doctor.d.ts +104 -0
- package/dist/management/doctor.d.ts.map +1 -0
- package/dist/management/doctor.js +673 -0
- package/dist/management/doctor.js.map +1 -0
- package/dist/management/instance-manager.d.ts +57 -0
- package/dist/management/instance-manager.d.ts.map +1 -0
- package/dist/management/instance-manager.js +195 -0
- package/dist/management/instance-manager.js.map +1 -0
- package/dist/management/recovery-manager.d.ts +39 -0
- package/dist/management/recovery-manager.d.ts.map +1 -0
- package/dist/management/recovery-manager.js +141 -0
- package/dist/management/recovery-manager.js.map +1 -0
- package/dist/management/shared-manager.d.ts +47 -0
- package/dist/management/shared-manager.d.ts.map +1 -0
- package/dist/management/shared-manager.js +388 -0
- package/dist/management/shared-manager.js.map +1 -0
- package/dist/types/cli.d.ts +50 -0
- package/dist/types/cli.d.ts.map +1 -0
- package/dist/types/cli.js +16 -0
- package/dist/types/cli.js.map +1 -0
- package/dist/types/config.d.ts +51 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +26 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/delegation.d.ts +61 -0
- package/dist/types/delegation.d.ts.map +1 -0
- package/dist/types/delegation.js +6 -0
- package/dist/types/delegation.js.map +1 -0
- package/dist/types/glmt.d.ts +95 -0
- package/dist/types/glmt.d.ts.map +1 -0
- package/dist/types/glmt.js +7 -0
- package/dist/types/glmt.js.map +1 -0
- package/dist/types/index.d.ts +13 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +16 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/utils.d.ts +36 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +22 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/utils/claude-detector.d.ts +14 -0
- package/dist/utils/claude-detector.d.ts.map +1 -0
- package/dist/utils/claude-detector.js +112 -0
- package/dist/utils/claude-detector.js.map +1 -0
- package/dist/utils/claude-dir-installer.d.ts +46 -0
- package/dist/utils/claude-dir-installer.d.ts.map +1 -0
- package/dist/utils/claude-dir-installer.js +289 -0
- package/dist/utils/claude-dir-installer.js.map +1 -0
- package/dist/utils/claude-symlink-manager.d.ts +61 -0
- package/dist/utils/claude-symlink-manager.d.ts.map +1 -0
- package/dist/utils/claude-symlink-manager.js +291 -0
- package/dist/utils/claude-symlink-manager.js.map +1 -0
- package/dist/utils/config-manager.d.ts +32 -0
- package/dist/utils/config-manager.d.ts.map +1 -0
- package/dist/utils/config-manager.js +143 -0
- package/dist/utils/config-manager.js.map +1 -0
- package/dist/utils/delegation-validator.d.ts +39 -0
- package/dist/utils/delegation-validator.d.ts.map +1 -0
- package/dist/utils/delegation-validator.js +161 -0
- package/dist/utils/delegation-validator.js.map +1 -0
- package/dist/utils/error-codes.d.ts +36 -0
- package/dist/utils/error-codes.d.ts.map +1 -0
- package/dist/utils/error-codes.js +63 -0
- package/dist/utils/error-codes.js.map +1 -0
- package/dist/utils/error-manager.d.ts +59 -0
- package/dist/utils/error-manager.d.ts.map +1 -0
- package/dist/utils/error-manager.js +228 -0
- package/dist/utils/error-manager.js.map +1 -0
- package/dist/utils/helpers.d.ts +27 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/helpers.js +150 -0
- package/dist/utils/helpers.js.map +1 -0
- package/dist/utils/package-manager-detector.d.ts +14 -0
- package/dist/utils/package-manager-detector.d.ts.map +1 -0
- package/dist/utils/package-manager-detector.js +162 -0
- package/dist/utils/package-manager-detector.js.map +1 -0
- package/dist/utils/progress-indicator.d.ts +52 -0
- package/dist/utils/progress-indicator.d.ts.map +1 -0
- package/dist/utils/progress-indicator.js +102 -0
- package/dist/utils/progress-indicator.js.map +1 -0
- package/dist/utils/prompt.d.ts +29 -0
- package/dist/utils/prompt.d.ts.map +1 -0
- package/dist/utils/prompt.js +116 -0
- package/dist/utils/prompt.js.map +1 -0
- package/dist/utils/shell-completion.d.ts +52 -0
- package/dist/utils/shell-completion.d.ts.map +1 -0
- package/dist/utils/shell-completion.js +231 -0
- package/dist/utils/shell-completion.js.map +1 -0
- package/dist/utils/shell-executor.d.ts +15 -0
- package/dist/utils/shell-executor.d.ts.map +1 -0
- package/dist/utils/shell-executor.js +57 -0
- package/dist/utils/shell-executor.js.map +1 -0
- package/dist/utils/update-checker.d.ts +48 -0
- package/dist/utils/update-checker.d.ts.map +1 -0
- package/dist/utils/update-checker.js +241 -0
- package/dist/utils/update-checker.js.map +1 -0
- package/lib/ccs +21 -1907
- package/lib/ccs.ps1 +26 -1800
- package/lib/error-codes.ps1 +2 -1
- package/lib/prompt.ps1 +2 -2
- package/package.json +31 -11
- package/scripts/add-shebang.js +39 -0
- package/scripts/bump-version.sh +25 -37
- package/scripts/dev-install.sh +32 -11
- package/scripts/postinstall.js +29 -29
- package/bin/auth/auth-commands.js +0 -499
- package/bin/auth/profile-detector.js +0 -204
- package/bin/auth/profile-registry.js +0 -225
- package/bin/ccs.js +0 -1034
- package/bin/delegation/README.md +0 -191
- package/bin/delegation/delegation-handler.js +0 -212
- package/bin/delegation/headless-executor.js +0 -618
- package/bin/delegation/result-formatter.js +0 -485
- package/bin/delegation/session-manager.js +0 -157
- package/bin/delegation/settings-parser.js +0 -109
- package/bin/glmt/delta-accumulator.js +0 -276
- package/bin/glmt/glmt-proxy.js +0 -495
- package/bin/glmt/glmt-transformer.js +0 -999
- package/bin/glmt/locale-enforcer.js +0 -72
- package/bin/glmt/reasoning-enforcer.js +0 -173
- package/bin/glmt/sse-parser.js +0 -96
- package/bin/management/doctor.js +0 -721
- package/bin/management/instance-manager.js +0 -202
- package/bin/management/recovery-manager.js +0 -135
- package/bin/management/shared-manager.js +0 -402
- package/bin/utils/claude-detector.js +0 -73
- package/bin/utils/claude-dir-installer.js +0 -283
- package/bin/utils/claude-symlink-manager.js +0 -289
- package/bin/utils/config-manager.js +0 -103
- package/bin/utils/delegation-validator.js +0 -154
- package/bin/utils/error-codes.js +0 -59
- package/bin/utils/error-manager.js +0 -165
- package/bin/utils/helpers.js +0 -136
- package/bin/utils/progress-indicator.js +0 -111
- package/bin/utils/prompt.js +0 -134
- package/bin/utils/shell-completion.js +0 -256
- package/bin/utils/update-checker.js +0 -243
|
@@ -1,225 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const fs = require('fs');
|
|
4
|
-
const path = require('path');
|
|
5
|
-
const os = require('os');
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Profile Registry (Simplified)
|
|
9
|
-
*
|
|
10
|
-
* Manages account profile metadata in ~/.ccs/profiles.json
|
|
11
|
-
* Each profile represents an isolated Claude instance with login credentials.
|
|
12
|
-
*
|
|
13
|
-
* Profile Schema (v3.0 - Minimal):
|
|
14
|
-
* {
|
|
15
|
-
* type: 'account', // Profile type
|
|
16
|
-
* created: <ISO timestamp>, // Creation time
|
|
17
|
-
* last_used: <ISO timestamp or null> // Last usage time
|
|
18
|
-
* }
|
|
19
|
-
*
|
|
20
|
-
* Removed fields from v2.x:
|
|
21
|
-
* - vault: No encrypted vault (credentials in instance)
|
|
22
|
-
* - subscription: No credential reading
|
|
23
|
-
* - email: No credential reading
|
|
24
|
-
*/
|
|
25
|
-
class ProfileRegistry {
|
|
26
|
-
constructor() {
|
|
27
|
-
this.profilesPath = path.join(os.homedir(), '.ccs', 'profiles.json');
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Read profiles from disk
|
|
32
|
-
* @returns {Object} Profiles data
|
|
33
|
-
*/
|
|
34
|
-
_read() {
|
|
35
|
-
if (!fs.existsSync(this.profilesPath)) {
|
|
36
|
-
return {
|
|
37
|
-
version: '2.0.0',
|
|
38
|
-
profiles: {},
|
|
39
|
-
default: null
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
try {
|
|
44
|
-
const data = fs.readFileSync(this.profilesPath, 'utf8');
|
|
45
|
-
return JSON.parse(data);
|
|
46
|
-
} catch (error) {
|
|
47
|
-
throw new Error(`Failed to read profiles: ${error.message}`);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Write profiles to disk atomically
|
|
53
|
-
* @param {Object} data - Profiles data
|
|
54
|
-
*/
|
|
55
|
-
_write(data) {
|
|
56
|
-
const dir = path.dirname(this.profilesPath);
|
|
57
|
-
|
|
58
|
-
// Ensure directory exists
|
|
59
|
-
if (!fs.existsSync(dir)) {
|
|
60
|
-
fs.mkdirSync(dir, { recursive: true, mode: 0o700 });
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// Atomic write: temp file + rename
|
|
64
|
-
const tempPath = `${this.profilesPath}.tmp`;
|
|
65
|
-
|
|
66
|
-
try {
|
|
67
|
-
fs.writeFileSync(tempPath, JSON.stringify(data, null, 2), { mode: 0o600 });
|
|
68
|
-
fs.renameSync(tempPath, this.profilesPath);
|
|
69
|
-
} catch (error) {
|
|
70
|
-
// Cleanup temp file on error
|
|
71
|
-
if (fs.existsSync(tempPath)) {
|
|
72
|
-
fs.unlinkSync(tempPath);
|
|
73
|
-
}
|
|
74
|
-
throw new Error(`Failed to write profiles: ${error.message}`);
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Create a new profile
|
|
80
|
-
* @param {string} name - Profile name
|
|
81
|
-
* @param {Object} metadata - Profile metadata (type, created, last_used)
|
|
82
|
-
*/
|
|
83
|
-
createProfile(name, metadata = {}) {
|
|
84
|
-
const data = this._read();
|
|
85
|
-
|
|
86
|
-
if (data.profiles[name]) {
|
|
87
|
-
throw new Error(`Profile already exists: ${name}`);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// v3.0 minimal schema: only essential fields
|
|
91
|
-
data.profiles[name] = {
|
|
92
|
-
type: metadata.type || 'account',
|
|
93
|
-
created: new Date().toISOString(),
|
|
94
|
-
last_used: null
|
|
95
|
-
};
|
|
96
|
-
|
|
97
|
-
// Note: No longer auto-set as default
|
|
98
|
-
// Users must explicitly run: ccs auth default <profile>
|
|
99
|
-
// Default always stays on implicit 'default' profile (uses ~/.claude/)
|
|
100
|
-
|
|
101
|
-
this._write(data);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Get profile metadata
|
|
106
|
-
* @param {string} name - Profile name
|
|
107
|
-
* @returns {Object} Profile metadata
|
|
108
|
-
*/
|
|
109
|
-
getProfile(name) {
|
|
110
|
-
const data = this._read();
|
|
111
|
-
|
|
112
|
-
if (!data.profiles[name]) {
|
|
113
|
-
throw new Error(`Profile not found: ${name}`);
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return data.profiles[name];
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Update profile metadata
|
|
121
|
-
* @param {string} name - Profile name
|
|
122
|
-
* @param {Object} updates - Fields to update
|
|
123
|
-
*/
|
|
124
|
-
updateProfile(name, updates) {
|
|
125
|
-
const data = this._read();
|
|
126
|
-
|
|
127
|
-
if (!data.profiles[name]) {
|
|
128
|
-
throw new Error(`Profile not found: ${name}`);
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
data.profiles[name] = {
|
|
132
|
-
...data.profiles[name],
|
|
133
|
-
...updates
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
this._write(data);
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Delete a profile
|
|
141
|
-
* @param {string} name - Profile name
|
|
142
|
-
*/
|
|
143
|
-
deleteProfile(name) {
|
|
144
|
-
const data = this._read();
|
|
145
|
-
|
|
146
|
-
if (!data.profiles[name]) {
|
|
147
|
-
throw new Error(`Profile not found: ${name}`);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
delete data.profiles[name];
|
|
151
|
-
|
|
152
|
-
// Clear default if it was the deleted profile
|
|
153
|
-
if (data.default === name) {
|
|
154
|
-
// Set to first remaining profile or null
|
|
155
|
-
const remaining = Object.keys(data.profiles);
|
|
156
|
-
data.default = remaining.length > 0 ? remaining[0] : null;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
this._write(data);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* List all profiles
|
|
164
|
-
* @returns {Array} Array of profile names
|
|
165
|
-
*/
|
|
166
|
-
listProfiles() {
|
|
167
|
-
const data = this._read();
|
|
168
|
-
return Object.keys(data.profiles);
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
/**
|
|
172
|
-
* Get all profiles with metadata
|
|
173
|
-
* @returns {Object} All profiles
|
|
174
|
-
*/
|
|
175
|
-
getAllProfiles() {
|
|
176
|
-
const data = this._read();
|
|
177
|
-
return data.profiles;
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Get default profile name
|
|
182
|
-
* @returns {string|null} Default profile name
|
|
183
|
-
*/
|
|
184
|
-
getDefaultProfile() {
|
|
185
|
-
const data = this._read();
|
|
186
|
-
return data.default;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* Set default profile
|
|
191
|
-
* @param {string} name - Profile name
|
|
192
|
-
*/
|
|
193
|
-
setDefaultProfile(name) {
|
|
194
|
-
const data = this._read();
|
|
195
|
-
|
|
196
|
-
if (!data.profiles[name]) {
|
|
197
|
-
throw new Error(`Profile not found: ${name}`);
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
data.default = name;
|
|
201
|
-
this._write(data);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* Check if profile exists
|
|
206
|
-
* @param {string} name - Profile name
|
|
207
|
-
* @returns {boolean}
|
|
208
|
-
*/
|
|
209
|
-
hasProfile(name) {
|
|
210
|
-
const data = this._read();
|
|
211
|
-
return !!data.profiles[name];
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
/**
|
|
215
|
-
* Update last used timestamp
|
|
216
|
-
* @param {string} name - Profile name
|
|
217
|
-
*/
|
|
218
|
-
touchProfile(name) {
|
|
219
|
-
this.updateProfile(name, {
|
|
220
|
-
last_used: new Date().toISOString()
|
|
221
|
-
});
|
|
222
|
-
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
module.exports = ProfileRegistry;
|