@nemus-cli/nemus 0.9.0 → 0.10.0
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/CHANGELOG.md +18 -0
- package/README.md +10 -5
- package/bin/workspace.js +12 -0
- package/dist/commands/analyze-deps.js +5 -12
- package/dist/commands/archive.js +13 -18
- package/dist/commands/branch/create.js +5 -12
- package/dist/commands/branch/switch.js +14 -25
- package/dist/commands/cache/manager.js +13 -24
- package/dist/commands/cleanup.js +14 -26
- package/dist/commands/configure-claude.js +4 -8
- package/dist/commands/configure.js +38 -32
- package/dist/commands/dashboard/session-picker.js +19 -26
- package/dist/commands/dashboard/workspace-picker.js +19 -26
- package/dist/commands/delete.js +15 -30
- package/dist/commands/ghq-status.js +7 -12
- package/dist/commands/go.js +18 -27
- package/dist/commands/history.js +6 -13
- package/dist/commands/list.js +20 -29
- package/dist/commands/remove-repo.js +21 -29
- package/dist/commands/save-context.js +5 -10
- package/dist/commands/sessions.js +19 -25
- package/dist/commands/suite/create.js +27 -53
- package/dist/commands/suite/delete.js +13 -25
- package/dist/commands/suite/export.js +20 -36
- package/dist/commands/suite/import.js +9 -20
- package/dist/commands/suite/use.js +9 -17
- package/dist/utils/prompt.js +26 -0
- package/dist/utils/prompts.js +86 -118
- package/package.json +3 -6
- package/src/commands/analyze-deps.ts +5 -9
- package/src/commands/archive.ts +5 -7
- package/src/commands/branch/create.ts +5 -9
- package/src/commands/branch/switch.ts +14 -22
- package/src/commands/cache/manager.ts +13 -21
- package/src/commands/cleanup.ts +14 -23
- package/src/commands/configure-claude.ts +4 -5
- package/src/commands/configure.ts +35 -29
- package/src/commands/dashboard/session-picker.ts +6 -11
- package/src/commands/dashboard/workspace-picker.ts +6 -11
- package/src/commands/delete.test.ts +36 -42
- package/src/commands/delete.ts +15 -27
- package/src/commands/ghq-status.ts +5 -7
- package/src/commands/go.ts +18 -25
- package/src/commands/history.ts +6 -10
- package/src/commands/list.test.ts +19 -26
- package/src/commands/list.ts +24 -31
- package/src/commands/remove-repo.ts +11 -17
- package/src/commands/save-context.ts +3 -5
- package/src/commands/sessions.ts +6 -10
- package/src/commands/suite/create.ts +28 -50
- package/src/commands/suite/delete.ts +14 -23
- package/src/commands/suite/export.ts +20 -33
- package/src/commands/suite/import.ts +9 -17
- package/src/commands/suite/use.ts +9 -14
- package/src/utils/prompt.ts +16 -0
- package/src/utils/prompts.test.ts +70 -41
- package/src/utils/prompts.ts +98 -128
|
@@ -38,17 +38,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
38
38
|
return result;
|
|
39
39
|
};
|
|
40
40
|
})();
|
|
41
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
42
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
|
-
};
|
|
44
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
42
|
const workspace_meta_1 = require("../../utils/workspace-meta");
|
|
46
43
|
const launcher_1 = require("./launcher");
|
|
47
44
|
const agent_config_1 = require("../../utils/agent-config");
|
|
48
|
-
const
|
|
49
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
45
|
+
const prompt_1 = require("../../utils/prompt");
|
|
50
46
|
const fuzzy = __importStar(require("fuzzy"));
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
async function main() {
|
|
53
48
|
try {
|
|
54
49
|
const workspaces = await (0, workspace_meta_1.listWorkspaces)();
|
|
@@ -61,26 +56,24 @@ async function main() {
|
|
|
61
56
|
path: ws.path,
|
|
62
57
|
repoCount: ws.metadata?.repositories?.length ?? 0,
|
|
63
58
|
}));
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
pageSize: 15,
|
|
83
|
-
}]);
|
|
59
|
+
const selected = await (0, prompt_1.search)({
|
|
60
|
+
message: 'Select workspace to launch agent in:',
|
|
61
|
+
pageSize: 15,
|
|
62
|
+
source: async (term) => {
|
|
63
|
+
const searchInput = term || '';
|
|
64
|
+
const source = items.map(item => ({
|
|
65
|
+
name: `${item.name} (${item.repoCount} repos)`,
|
|
66
|
+
value: item,
|
|
67
|
+
}));
|
|
68
|
+
if (!searchInput)
|
|
69
|
+
return source;
|
|
70
|
+
const results = fuzzy.filter(searchInput, items, { extract: (item) => item.name });
|
|
71
|
+
return results.map(result => ({
|
|
72
|
+
name: `${result.original.name} (${result.original.repoCount} repos)`,
|
|
73
|
+
value: result.original,
|
|
74
|
+
}));
|
|
75
|
+
},
|
|
76
|
+
});
|
|
84
77
|
const workspace = selected;
|
|
85
78
|
const agent = (0, agent_config_1.getPrimaryAgent)();
|
|
86
79
|
(0, launcher_1.launchAgentPane)(workspace.path, agent.launchCommand);
|
package/dist/commands/delete.js
CHANGED
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerDeleteCommand = registerDeleteCommand;
|
|
40
37
|
exports.main = main;
|
|
@@ -44,7 +41,7 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
44
41
|
const prompts_1 = require("../utils/prompts");
|
|
45
42
|
const logger_1 = require("../utils/logger");
|
|
46
43
|
const colors_1 = require("../utils/colors");
|
|
47
|
-
const
|
|
44
|
+
const prompt_1 = require("../utils/prompt");
|
|
48
45
|
const command_helpers_1 = require("../utils/command-helpers");
|
|
49
46
|
function registerDeleteCommand(parent) {
|
|
50
47
|
parent
|
|
@@ -105,16 +102,12 @@ async function handleDelete(opts) {
|
|
|
105
102
|
console.log('');
|
|
106
103
|
(0, logger_1.logWarning)('This will permanently delete all cloned repositories in the selected workspaces!');
|
|
107
104
|
if (!opts.yes) {
|
|
108
|
-
const
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
: `Delete these ${targets.length} workspaces?`,
|
|
115
|
-
default: true,
|
|
116
|
-
},
|
|
117
|
-
]);
|
|
105
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
106
|
+
message: targets.length === 1
|
|
107
|
+
? `Delete workspace ${targets[0].name}?`
|
|
108
|
+
: `Delete these ${targets.length} workspaces?`,
|
|
109
|
+
default: true,
|
|
110
|
+
});
|
|
118
111
|
if (!confirmed) {
|
|
119
112
|
(0, logger_1.logInfo)('Deletion cancelled');
|
|
120
113
|
process.exit(0);
|
|
@@ -171,14 +164,10 @@ async function handleDelete(opts) {
|
|
|
171
164
|
const confirmMessage = resolved.length === 1
|
|
172
165
|
? `Delete workspace ${resolved[0].name}?`
|
|
173
166
|
: `Delete these ${resolved.length} workspaces?`;
|
|
174
|
-
const
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
message: confirmMessage,
|
|
179
|
-
default: true,
|
|
180
|
-
},
|
|
181
|
-
]);
|
|
167
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
168
|
+
message: confirmMessage,
|
|
169
|
+
default: true,
|
|
170
|
+
});
|
|
182
171
|
if (confirmed) {
|
|
183
172
|
for (const { name, path: workspacePath } of resolved) {
|
|
184
173
|
try {
|
|
@@ -198,14 +187,10 @@ async function handleDelete(opts) {
|
|
|
198
187
|
(0, logger_1.logInfo)('No more workspaces remaining');
|
|
199
188
|
break;
|
|
200
189
|
}
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
message: 'Delete more workspaces?',
|
|
206
|
-
default: false,
|
|
207
|
-
},
|
|
208
|
-
]);
|
|
190
|
+
const deleteMore = await (0, prompt_1.confirm)({
|
|
191
|
+
message: 'Delete more workspaces?',
|
|
192
|
+
default: false,
|
|
193
|
+
});
|
|
209
194
|
if (!deleteMore) {
|
|
210
195
|
break;
|
|
211
196
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.registerGhqStatusCommand = registerGhqStatusCommand;
|
|
7
4
|
const ghq_integration_1 = require("../utils/ghq-integration");
|
|
8
5
|
const logger_1 = require("../utils/logger");
|
|
9
6
|
const colors_1 = require("../utils/colors");
|
|
10
|
-
const
|
|
7
|
+
const prompt_1 = require("../utils/prompt");
|
|
11
8
|
function registerGhqStatusCommand(parent) {
|
|
12
9
|
parent
|
|
13
10
|
.command('ghq-status')
|
|
@@ -30,10 +27,9 @@ async function handleGhqStatus() {
|
|
|
30
27
|
console.log(` Managed repositories: ${(0, colors_1.colorize)(String(status.repoCount || 0), 'yellow')}`);
|
|
31
28
|
console.log('');
|
|
32
29
|
if (status.repoCount && status.repoCount > 0) {
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}]);
|
|
30
|
+
const showRepos = await (0, prompt_1.confirm)({
|
|
31
|
+
message: `View all ${status.repoCount} managed repositories?`, default: false,
|
|
32
|
+
});
|
|
37
33
|
if (showRepos) {
|
|
38
34
|
const repos = await (0, ghq_integration_1.ghqList)();
|
|
39
35
|
console.log('');
|
|
@@ -47,10 +43,9 @@ async function handleGhqStatus() {
|
|
|
47
43
|
(0, logger_1.logWarning)('ghq is not installed');
|
|
48
44
|
console.log('');
|
|
49
45
|
console.log('The workspace manager will use direct git clones.');
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}]);
|
|
46
|
+
const showInfo = await (0, prompt_1.confirm)({
|
|
47
|
+
message: 'Show ghq installation information?', default: true,
|
|
48
|
+
});
|
|
54
49
|
if (showInfo) {
|
|
55
50
|
(0, ghq_integration_1.displayGhqInfo)();
|
|
56
51
|
}
|
package/dist/commands/go.js
CHANGED
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerGoCommand = registerGoCommand;
|
|
40
37
|
const path = __importStar(require("path"));
|
|
@@ -45,10 +42,8 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
45
42
|
const claude_sessions_1 = require("../utils/claude-sessions");
|
|
46
43
|
const logger_1 = require("../utils/logger");
|
|
47
44
|
const colors_1 = require("../utils/colors");
|
|
48
|
-
const
|
|
49
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
45
|
+
const prompt_1 = require("../utils/prompt");
|
|
50
46
|
const fuzzy = __importStar(require("fuzzy"));
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
const TEMP_FILE = path.join(os.homedir(), '.workspace-last-go');
|
|
53
48
|
const RESUME_FLAG_FILE = path.join(os.homedir(), '.workspace-resume-session');
|
|
54
49
|
function registerGoCommand(parent) {
|
|
@@ -100,28 +95,24 @@ async function handleGo(workspaceArg) {
|
|
|
100
95
|
return 1;
|
|
101
96
|
return 0;
|
|
102
97
|
});
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
source
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
value: result.original.name,
|
|
120
|
-
}));
|
|
121
|
-
},
|
|
122
|
-
pageSize: 15,
|
|
98
|
+
const workspaceName = await (0, prompt_1.search)({
|
|
99
|
+
message: 'Select workspace to navigate to:',
|
|
100
|
+
pageSize: 15,
|
|
101
|
+
source: async (term) => {
|
|
102
|
+
const searchInput = term || '';
|
|
103
|
+
const source = items.map(item => ({
|
|
104
|
+
name: `${item.name} ${item.lastActiveLabel ? (0, colors_1.colorize)(item.lastActiveLabel, 'dim') : (0, colors_1.colorize)('no session', 'dim')} ${(0, colors_1.colorize)(`${item.repoCount} repos`, 'dim')}`,
|
|
105
|
+
value: item.name,
|
|
106
|
+
}));
|
|
107
|
+
if (!searchInput)
|
|
108
|
+
return source;
|
|
109
|
+
const results = fuzzy.filter(searchInput, items, { extract: (item) => item.name });
|
|
110
|
+
return results.map(result => ({
|
|
111
|
+
name: `${result.original.name} ${result.original.lastActiveLabel ? (0, colors_1.colorize)(result.original.lastActiveLabel, 'dim') : (0, colors_1.colorize)('no session', 'dim')} ${(0, colors_1.colorize)(`${result.original.repoCount} repos`, 'dim')}`,
|
|
112
|
+
value: result.original.name,
|
|
113
|
+
}));
|
|
123
114
|
},
|
|
124
|
-
|
|
115
|
+
});
|
|
125
116
|
selectedWorkspace = workspaceName;
|
|
126
117
|
}
|
|
127
118
|
const workspacePath = path.join(config_1.WORKSPACES_DIR, selectedWorkspace);
|
package/dist/commands/history.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.registerHistoryCommand = registerHistoryCommand;
|
|
7
4
|
const history_1 = require("../utils/history");
|
|
8
5
|
const logger_1 = require("../utils/logger");
|
|
9
6
|
const colors_1 = require("../utils/colors");
|
|
10
|
-
const
|
|
7
|
+
const prompt_1 = require("../utils/prompt");
|
|
11
8
|
const command_helpers_1 = require("../utils/command-helpers");
|
|
12
9
|
const displayHistoryTable = (records) => {
|
|
13
10
|
if (records.length === 0) {
|
|
@@ -78,15 +75,11 @@ function registerHistoryCommand(parent) {
|
|
|
78
75
|
(0, logger_1.logSuccess)('Operation history cleared');
|
|
79
76
|
return;
|
|
80
77
|
}
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
default: false,
|
|
87
|
-
},
|
|
88
|
-
]);
|
|
89
|
-
if (confirm) {
|
|
78
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
79
|
+
message: 'Are you sure you want to clear operation history?',
|
|
80
|
+
default: false,
|
|
81
|
+
});
|
|
82
|
+
if (confirmed) {
|
|
90
83
|
await (0, history_1.clearHistory)();
|
|
91
84
|
(0, logger_1.logSuccess)('Operation history cleared');
|
|
92
85
|
}
|
package/dist/commands/list.js
CHANGED
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerListCommand = registerListCommand;
|
|
40
37
|
exports.main = main;
|
|
@@ -46,10 +43,8 @@ const claude_sessions_1 = require("../utils/claude-sessions");
|
|
|
46
43
|
const logger_1 = require("../utils/logger");
|
|
47
44
|
const output_1 = require("../utils/output");
|
|
48
45
|
const colors_1 = require("../utils/colors");
|
|
49
|
-
const
|
|
50
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
46
|
+
const prompt_1 = require("../utils/prompt");
|
|
51
47
|
const fuzzy = __importStar(require("fuzzy"));
|
|
52
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
53
48
|
const TEMP_FILE = path.join(os.homedir(), '.workspace-last-go');
|
|
54
49
|
const RESUME_FLAG_FILE = path.join(os.homedir(), '.workspace-resume-session');
|
|
55
50
|
function registerListCommand(parent) {
|
|
@@ -155,30 +150,26 @@ async function handleList(opts) {
|
|
|
155
150
|
}
|
|
156
151
|
console.log('');
|
|
157
152
|
if (items.length > 0 && (process.stdout.isTTY || process.env.VITEST === 'true')) {
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
source
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
})
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
value: result.original.name,
|
|
177
|
-
}));
|
|
178
|
-
},
|
|
179
|
-
pageSize: 15,
|
|
153
|
+
const selected = await (0, prompt_1.search)({
|
|
154
|
+
message: 'Select workspace to open:',
|
|
155
|
+
pageSize: 15,
|
|
156
|
+
source: async (term) => {
|
|
157
|
+
const searchInput = term || '';
|
|
158
|
+
const source = items.map(item => ({
|
|
159
|
+
name: `${item.name} ${item.lastActiveLabel ? (0, colors_1.colorize)(item.lastActiveLabel, 'dim') : (0, colors_1.colorize)('no session', 'dim')} ${(0, colors_1.colorize)(`${item.repoCount} repos`, 'dim')}`,
|
|
160
|
+
value: item.name,
|
|
161
|
+
}));
|
|
162
|
+
if (!searchInput)
|
|
163
|
+
return source;
|
|
164
|
+
const results = fuzzy.filter(searchInput, items, {
|
|
165
|
+
extract: (item) => item.name,
|
|
166
|
+
});
|
|
167
|
+
return results.map(result => ({
|
|
168
|
+
name: `${result.original.name} ${result.original.lastActiveLabel ? (0, colors_1.colorize)(result.original.lastActiveLabel, 'dim') : (0, colors_1.colorize)('no session', 'dim')} ${(0, colors_1.colorize)(`${result.original.repoCount} repos`, 'dim')}`,
|
|
169
|
+
value: result.original.name,
|
|
170
|
+
}));
|
|
180
171
|
},
|
|
181
|
-
|
|
172
|
+
});
|
|
182
173
|
const selectedItem = items.find(i => i.name === selected);
|
|
183
174
|
if (selectedItem) {
|
|
184
175
|
await fsPromises.writeFile(TEMP_FILE, selectedItem.wsPath, 'utf-8');
|
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerRemoveRepoCommand = registerRemoveRepoCommand;
|
|
40
37
|
const fs = __importStar(require("fs/promises"));
|
|
@@ -44,11 +41,9 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
44
41
|
const claude_integration_1 = require("../utils/claude-integration");
|
|
45
42
|
const logger_1 = require("../utils/logger");
|
|
46
43
|
const colors_1 = require("../utils/colors");
|
|
47
|
-
const
|
|
48
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
44
|
+
const prompt_1 = require("../utils/prompt");
|
|
49
45
|
const fuzzy = __importStar(require("fuzzy"));
|
|
50
46
|
const command_helpers_1 = require("../utils/command-helpers");
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
function registerRemoveRepoCommand(parent) {
|
|
53
48
|
parent
|
|
54
49
|
.command('remove-repo')
|
|
@@ -99,10 +94,9 @@ async function handleRemoveRepo(opts) {
|
|
|
99
94
|
(0, logger_1.logSuccess)(`Workspace "${workspaceName}" deleted.`);
|
|
100
95
|
}
|
|
101
96
|
else {
|
|
102
|
-
const
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
}]);
|
|
97
|
+
const deleteWorkspace = await (0, prompt_1.confirm)({
|
|
98
|
+
message: `Delete the entire workspace folder "${workspaceName}"?`, default: false,
|
|
99
|
+
});
|
|
106
100
|
if (deleteWorkspace) {
|
|
107
101
|
await fs.rm(workspacePath, { recursive: true, force: true });
|
|
108
102
|
(0, logger_1.logSuccess)(`Workspace "${workspaceName}" deleted.`);
|
|
@@ -135,20 +129,19 @@ async function handleRemoveRepo(opts) {
|
|
|
135
129
|
break;
|
|
136
130
|
}
|
|
137
131
|
try {
|
|
138
|
-
const
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
}]);
|
|
132
|
+
const repoDir = await (0, prompt_1.search)({
|
|
133
|
+
message: `Search and select repository (${(0, colors_1.colorize)(String(selectedDirs.length), 'cyan')} selected):`,
|
|
134
|
+
pageSize: 16,
|
|
135
|
+
source: async (term) => {
|
|
136
|
+
const searchInput = term || '';
|
|
137
|
+
const doneOption = { name: (0, colors_1.colorize)('done - Finish selection', 'green'), value: 'done' };
|
|
138
|
+
if (!searchInput || searchInput.toLowerCase().startsWith('done')) {
|
|
139
|
+
return [doneOption, ...available.map(e => ({ name: e.displayName, value: e.dirName }))];
|
|
140
|
+
}
|
|
141
|
+
const results = fuzzy.filter(searchInput, available, { extract: (e) => e.displayName });
|
|
142
|
+
return [doneOption, ...results.map(result => ({ name: result.original.displayName, value: result.original.dirName }))];
|
|
143
|
+
},
|
|
144
|
+
});
|
|
152
145
|
if (repoDir === 'done') {
|
|
153
146
|
if (selectedDirs.length === 0) {
|
|
154
147
|
console.log((0, colors_1.colorize)('\nYou must select at least one repository\n', 'yellow'));
|
|
@@ -170,11 +163,10 @@ async function handleRemoveRepo(opts) {
|
|
|
170
163
|
selectedDirs.forEach(dir => console.log(` - ${dir}`));
|
|
171
164
|
console.log('');
|
|
172
165
|
if (!opts.yes) {
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
if (!confirm) {
|
|
166
|
+
const confirmed = await (0, prompt_1.confirm)({
|
|
167
|
+
message: `Remove ${selectedDirs.length} instance(s)? This will delete the directories.`, default: false,
|
|
168
|
+
});
|
|
169
|
+
if (!confirmed) {
|
|
178
170
|
(0, logger_1.logInfo)('Removal cancelled');
|
|
179
171
|
process.exit(0);
|
|
180
172
|
}
|
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerSaveContextCommand = registerSaveContextCommand;
|
|
40
37
|
const path = __importStar(require("path"));
|
|
@@ -44,7 +41,7 @@ const logger_1 = require("../utils/logger");
|
|
|
44
41
|
const colors_1 = require("../utils/colors");
|
|
45
42
|
const workspace_meta_1 = require("../utils/workspace-meta");
|
|
46
43
|
const context_file_1 = require("../utils/context-file");
|
|
47
|
-
const
|
|
44
|
+
const prompt_1 = require("../utils/prompt");
|
|
48
45
|
const CONTEXT_FILENAME = 'CONTEXT.md';
|
|
49
46
|
function registerSaveContextCommand(parent) {
|
|
50
47
|
parent
|
|
@@ -102,12 +99,10 @@ async function resolveWorkspacePath(workspaceName) {
|
|
|
102
99
|
(0, logger_1.logError)('No workspaces found');
|
|
103
100
|
return null;
|
|
104
101
|
}
|
|
105
|
-
const
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
choices: workspaces.map(w => ({ name: w.name, value: w.name })),
|
|
110
|
-
}]);
|
|
102
|
+
const selected = await (0, prompt_1.select)({
|
|
103
|
+
message: 'Select workspace:',
|
|
104
|
+
choices: workspaces.map(w => ({ name: w.name, value: w.name })),
|
|
105
|
+
});
|
|
111
106
|
return { name: selected, path: path.join(config_1.WORKSPACES_DIR, selected) };
|
|
112
107
|
}
|
|
113
108
|
(0, logger_1.logError)('Could not determine workspace. Use --workspace <name> or run from within a workspace.');
|
|
@@ -32,9 +32,6 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
32
32
|
return result;
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
-
};
|
|
38
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
36
|
exports.registerSessionsCommand = registerSessionsCommand;
|
|
40
37
|
const path = __importStar(require("path"));
|
|
@@ -45,10 +42,8 @@ const workspace_meta_1 = require("../utils/workspace-meta");
|
|
|
45
42
|
const logger_1 = require("../utils/logger");
|
|
46
43
|
const output_1 = require("../utils/output");
|
|
47
44
|
const colors_1 = require("../utils/colors");
|
|
48
|
-
const
|
|
49
|
-
const inquirer_autocomplete_prompt_1 = __importDefault(require("inquirer-autocomplete-prompt"));
|
|
45
|
+
const prompt_1 = require("../utils/prompt");
|
|
50
46
|
const fuzzy = __importStar(require("fuzzy"));
|
|
51
|
-
inquirer_1.default.registerPrompt('autocomplete', inquirer_autocomplete_prompt_1.default);
|
|
52
47
|
const TEMP_FILE = path.join(os.homedir(), '.workspace-last-go');
|
|
53
48
|
const RESUME_FLAG_FILE = path.join(os.homedir(), '.workspace-resume-session');
|
|
54
49
|
function registerSessionsCommand(parent) {
|
|
@@ -111,25 +106,24 @@ async function handleSessions(opts = {}) {
|
|
|
111
106
|
console.log((0, colors_1.colorize)(` ... and ${items.length - 10} more`, 'dim'));
|
|
112
107
|
}
|
|
113
108
|
console.log('');
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
}]);
|
|
109
|
+
const selected = await (0, prompt_1.search)({
|
|
110
|
+
message: 'Select workspace to resume:',
|
|
111
|
+
pageSize: 15,
|
|
112
|
+
source: async (term) => {
|
|
113
|
+
const searchInput = term || '';
|
|
114
|
+
const source = items.map(item => ({
|
|
115
|
+
name: `${item.session.workspaceName} ${(0, colors_1.colorize)(item.session.lastActiveLabel, 'dim')} ${(0, colors_1.colorize)(item.repoLabel, 'dim')}`,
|
|
116
|
+
value: item.session,
|
|
117
|
+
}));
|
|
118
|
+
if (!searchInput)
|
|
119
|
+
return source;
|
|
120
|
+
const results = fuzzy.filter(searchInput, items, { extract: (item) => item.session.workspaceName });
|
|
121
|
+
return results.map(result => ({
|
|
122
|
+
name: `${result.original.session.workspaceName} ${(0, colors_1.colorize)(result.original.session.lastActiveLabel, 'dim')} ${(0, colors_1.colorize)(result.original.repoLabel, 'dim')}`,
|
|
123
|
+
value: result.original.session,
|
|
124
|
+
}));
|
|
125
|
+
},
|
|
126
|
+
});
|
|
133
127
|
const session = selected;
|
|
134
128
|
await fs.writeFile(TEMP_FILE, session.workspacePath, 'utf-8');
|
|
135
129
|
// Write JSON with session ID and agent type for correct resume
|