@nemus-cli/nemus 0.2.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/CHANGELOG.md +86 -0
- package/LICENSE +21 -0
- package/README.md +275 -0
- package/assets/README.md +53 -0
- package/assets/banner.png +0 -0
- package/assets/banner.svg +66 -0
- package/assets/favicon-32.png +0 -0
- package/assets/favicon-64.png +0 -0
- package/assets/icon-256.png +0 -0
- package/assets/icon.svg +23 -0
- package/assets/logo-256.png +0 -0
- package/assets/logo-512.png +0 -0
- package/assets/logo-wordmark.svg +35 -0
- package/assets/logo.svg +32 -0
- package/bin/workspace.js +130 -0
- package/dist/cli/ai-prompt.js +421 -0
- package/dist/cli/dashboard/AgentList.js +61 -0
- package/dist/cli/dashboard/DashboardSidebar.js +280 -0
- package/dist/cli/dashboard/HelpFooter.js +73 -0
- package/dist/cli/dashboard/StatusBadge.js +50 -0
- package/dist/cli/dashboard/index.js +11 -0
- package/dist/cli/dashboard/types.js +2 -0
- package/dist/cli/tui.js +48 -0
- package/dist/commands/ai-prompt.js +22 -0
- package/dist/commands/analyze-deps.js +138 -0
- package/dist/commands/archive.js +113 -0
- package/dist/commands/branch/create.js +119 -0
- package/dist/commands/branch/index.js +104 -0
- package/dist/commands/branch/merge.js +90 -0
- package/dist/commands/branch/rebase.js +84 -0
- package/dist/commands/branch/switch.js +165 -0
- package/dist/commands/cache/index.js +80 -0
- package/dist/commands/cache/manager.js +198 -0
- package/dist/commands/cleanup.js +153 -0
- package/dist/commands/configure-claude.js +55 -0
- package/dist/commands/configure.js +231 -0
- package/dist/commands/create.js +204 -0
- package/dist/commands/dashboard/hook-handler.js +162 -0
- package/dist/commands/dashboard/index.js +258 -0
- package/dist/commands/dashboard/launcher.js +40 -0
- package/dist/commands/dashboard/session-picker.js +106 -0
- package/dist/commands/dashboard/sidebar.js +39 -0
- package/dist/commands/dashboard/workspace-picker.js +95 -0
- package/dist/commands/delete.js +194 -0
- package/dist/commands/deprecated-aliases.js +44 -0
- package/dist/commands/diff.js +129 -0
- package/dist/commands/doctor.js +141 -0
- package/dist/commands/generate-docs.js +77 -0
- package/dist/commands/ghq-status.js +72 -0
- package/dist/commands/go.js +154 -0
- package/dist/commands/history.js +124 -0
- package/dist/commands/list.js +191 -0
- package/dist/commands/mcp/index.js +69 -0
- package/dist/commands/migrate.js +296 -0
- package/dist/commands/remove-repo.js +217 -0
- package/dist/commands/report-bug.js +112 -0
- package/dist/commands/run.js +147 -0
- package/dist/commands/save-context.js +171 -0
- package/dist/commands/sessions.js +129 -0
- package/dist/commands/status.js +138 -0
- package/dist/commands/suite/create.js +212 -0
- package/dist/commands/suite/delete.js +64 -0
- package/dist/commands/suite/export.js +126 -0
- package/dist/commands/suite/import.js +128 -0
- package/dist/commands/suite/index.js +94 -0
- package/dist/commands/suite/list.js +49 -0
- package/dist/commands/suite/use.js +227 -0
- package/dist/commands/sync.js +117 -0
- package/dist/commands/update.js +203 -0
- package/dist/mcp/install.js +550 -0
- package/dist/mcp/server.js +398 -0
- package/dist/mcp/tools.js +922 -0
- package/dist/pi-extensions/permission-sync.ts.template +41 -0
- package/dist/pi-extensions/permissions-gate.ts.template +69 -0
- package/dist/pi-extensions/pr-fix-trigger.ts.template +124 -0
- package/dist/pi-extensions/review-reminder.ts.template +58 -0
- package/dist/pi-extensions/workspace-input-status.ts.template +919 -0
- package/dist/program.js +136 -0
- package/dist/scripts/workspace-table.py +394 -0
- package/dist/types/dashboard.js +11 -0
- package/dist/types/index.js +2 -0
- package/dist/utils/agent-config.js +263 -0
- package/dist/utils/agent-state.js +178 -0
- package/dist/utils/banner.js +24 -0
- package/dist/utils/branch-operations.js +232 -0
- package/dist/utils/bug-report.js +355 -0
- package/dist/utils/cache.js +168 -0
- package/dist/utils/claude-integration.js +617 -0
- package/dist/utils/claude-sessions.js +260 -0
- package/dist/utils/cleanup-operations.js +120 -0
- package/dist/utils/colors.js +26 -0
- package/dist/utils/command-helpers.js +44 -0
- package/dist/utils/config.js +150 -0
- package/dist/utils/context-file.js +33 -0
- package/dist/utils/dashboard-hooks.js +172 -0
- package/dist/utils/dependency-analyzer.js +234 -0
- package/dist/utils/diff-operations.js +80 -0
- package/dist/utils/doc-generator.js +184 -0
- package/dist/utils/ghq-integration.js +332 -0
- package/dist/utils/git-operations.js +237 -0
- package/dist/utils/git-status.js +187 -0
- package/dist/utils/github.js +68 -0
- package/dist/utils/health-checks.js +345 -0
- package/dist/utils/history.js +150 -0
- package/dist/utils/hooks.js +100 -0
- package/dist/utils/logger.js +40 -0
- package/dist/utils/permission-sync.js +681 -0
- package/dist/utils/pi-extensions.js +224 -0
- package/dist/utils/progress.js +92 -0
- package/dist/utils/prompts.js +279 -0
- package/dist/utils/repo-resolver.js +260 -0
- package/dist/utils/retry.js +65 -0
- package/dist/utils/run-operations.js +30 -0
- package/dist/utils/suite.js +159 -0
- package/dist/utils/sync-operations.js +107 -0
- package/dist/utils/tmux-dashboard.js +184 -0
- package/dist/utils/validation.js +153 -0
- package/dist/utils/version-check.js +121 -0
- package/dist/utils/workspace-meta.js +185 -0
- package/install-shell-integration.sh +532 -0
- package/install.sh +401 -0
- package/package.json +90 -0
- package/remove-shell-block.awk +44 -0
- package/scripts/postinstall.js +85 -0
- package/skills/analyze-deps.md +23 -0
- package/skills/archive-workspace.md +26 -0
- package/skills/branch-create.md +18 -0
- package/skills/create-workspace.md +39 -0
- package/skills/delete-workspace.md +37 -0
- package/skills/list-org-repos.md +26 -0
- package/skills/list-suites.md +24 -0
- package/skills/list-workspaces.md +27 -0
- package/skills/refresh-workspace-docs.md +89 -0
- package/skills/remove-repo.md +25 -0
- package/skills/run-command.md +23 -0
- package/skills/save-context.md +68 -0
- package/skills/search-repos.md +31 -0
- package/skills/snapshot-list.md +18 -0
- package/skills/snapshot-save.md +12 -0
- package/skills/switch-branch.md +18 -0
- package/skills/update-cache.md +21 -0
- package/skills/update-workspace.md +66 -0
- package/skills/workspace-cleanup.md +18 -0
- package/skills/workspace-diff.md +23 -0
- package/skills/workspace-doctor.md +23 -0
- package/skills/workspace-info.md +45 -0
- package/skills/workspace-manager/SKILL.md +201 -0
- package/skills/workspace-manager/references/ai-prompt.md +44 -0
- package/skills/workspace-manager/references/analyze-deps.md +45 -0
- package/skills/workspace-manager/references/archive-workspace.md +38 -0
- package/skills/workspace-manager/references/branch-create.md +31 -0
- package/skills/workspace-manager/references/branch-merge.md +22 -0
- package/skills/workspace-manager/references/branch-rebase.md +22 -0
- package/skills/workspace-manager/references/cache-clear.md +18 -0
- package/skills/workspace-manager/references/cache-info.md +22 -0
- package/skills/workspace-manager/references/configure-claude.md +31 -0
- package/skills/workspace-manager/references/configure.md +35 -0
- package/skills/workspace-manager/references/create-workspace.md +45 -0
- package/skills/workspace-manager/references/dashboard.md +61 -0
- package/skills/workspace-manager/references/delete-workspace.md +33 -0
- package/skills/workspace-manager/references/generate-docs.md +36 -0
- package/skills/workspace-manager/references/ghq-status.md +28 -0
- package/skills/workspace-manager/references/go.md +33 -0
- package/skills/workspace-manager/references/history.md +41 -0
- package/skills/workspace-manager/references/list-org-repos.md +26 -0
- package/skills/workspace-manager/references/list-suites.md +21 -0
- package/skills/workspace-manager/references/list-workspaces.md +27 -0
- package/skills/workspace-manager/references/mcp.md +49 -0
- package/skills/workspace-manager/references/remove-repo.md +26 -0
- package/skills/workspace-manager/references/run-command.md +44 -0
- package/skills/workspace-manager/references/search-repos.md +24 -0
- package/skills/workspace-manager/references/sessions.md +27 -0
- package/skills/workspace-manager/references/suite-create.md +22 -0
- package/skills/workspace-manager/references/suite-delete.md +21 -0
- package/skills/workspace-manager/references/suite-export.md +19 -0
- package/skills/workspace-manager/references/suite-import.md +19 -0
- package/skills/workspace-manager/references/suite-use.md +27 -0
- package/skills/workspace-manager/references/switch-branch.md +25 -0
- package/skills/workspace-manager/references/update-cache.md +22 -0
- package/skills/workspace-manager/references/update-workspace.md +50 -0
- package/skills/workspace-manager/references/workspace-cleanup.md +33 -0
- package/skills/workspace-manager/references/workspace-diff.md +27 -0
- package/skills/workspace-manager/references/workspace-doctor.md +27 -0
- package/skills/workspace-manager/references/workspace-info.md +33 -0
- package/skills/workspace-manager/references/workspace-status.md +43 -0
- package/skills/workspace-manager/references/workspace-sync.md +26 -0
- package/skills/workspace-status.md +26 -0
- package/skills/workspace-sync.md +23 -0
- package/src/cli/ai-prompt.test.ts +667 -0
- package/src/cli/ai-prompt.ts +421 -0
- package/src/cli/dashboard/AgentList.tsx +44 -0
- package/src/cli/dashboard/DashboardSidebar.tsx +291 -0
- package/src/cli/dashboard/HelpFooter.tsx +22 -0
- package/src/cli/dashboard/StatusBadge.tsx +23 -0
- package/src/cli/dashboard/index.ts +5 -0
- package/src/cli/dashboard/types.ts +16 -0
- package/src/cli/tui.tsx +51 -0
- package/src/cli/workspace-cli.test.ts +30 -0
- package/src/commands/ai-prompt.ts +21 -0
- package/src/commands/analyze-deps.ts +119 -0
- package/src/commands/archive.ts +114 -0
- package/src/commands/branch/create.ts +94 -0
- package/src/commands/branch/index.ts +74 -0
- package/src/commands/branch/merge.ts +61 -0
- package/src/commands/branch/rebase.ts +54 -0
- package/src/commands/branch/switch.ts +150 -0
- package/src/commands/cache/index.ts +51 -0
- package/src/commands/cache/manager.ts +168 -0
- package/src/commands/cleanup.ts +132 -0
- package/src/commands/configure-claude.ts +55 -0
- package/src/commands/configure.ts +204 -0
- package/src/commands/create.ts +196 -0
- package/src/commands/dashboard/hook-handler.ts +138 -0
- package/src/commands/dashboard/index.ts +248 -0
- package/src/commands/dashboard/launcher.ts +42 -0
- package/src/commands/dashboard/session-picker.ts +73 -0
- package/src/commands/dashboard/sidebar.js +39 -0
- package/src/commands/dashboard/workspace-picker.ts +62 -0
- package/src/commands/delete.test.ts +250 -0
- package/src/commands/delete.ts +171 -0
- package/src/commands/deprecated-aliases.ts +55 -0
- package/src/commands/diff.ts +106 -0
- package/src/commands/doctor.ts +110 -0
- package/src/commands/generate-docs.ts +45 -0
- package/src/commands/ghq-status.ts +70 -0
- package/src/commands/go.ts +125 -0
- package/src/commands/history.ts +136 -0
- package/src/commands/list.test.ts +219 -0
- package/src/commands/list.ts +176 -0
- package/src/commands/mcp/index.ts +39 -0
- package/src/commands/migrate.ts +277 -0
- package/src/commands/remove-repo.ts +194 -0
- package/src/commands/report-bug.ts +88 -0
- package/src/commands/run.ts +125 -0
- package/src/commands/save-context.test.ts +113 -0
- package/src/commands/save-context.ts +141 -0
- package/src/commands/sessions.ts +99 -0
- package/src/commands/status.ts +111 -0
- package/src/commands/suite/create.ts +240 -0
- package/src/commands/suite/delete.ts +65 -0
- package/src/commands/suite/export.ts +97 -0
- package/src/commands/suite/import.ts +100 -0
- package/src/commands/suite/index.ts +66 -0
- package/src/commands/suite/list.ts +54 -0
- package/src/commands/suite/use.ts +232 -0
- package/src/commands/sync.ts +97 -0
- package/src/commands/update.ts +197 -0
- package/src/mcp/install.ts +529 -0
- package/src/mcp/server.ts +579 -0
- package/src/mcp/tools.test.ts +545 -0
- package/src/mcp/tools.ts +1019 -0
- package/src/mcp/update-workspace.test.ts +220 -0
- package/src/pi-extensions/permission-sync.ts.template +41 -0
- package/src/pi-extensions/permissions-gate.ts.template +69 -0
- package/src/pi-extensions/pr-fix-trigger.ts.template +124 -0
- package/src/pi-extensions/review-reminder.ts.template +58 -0
- package/src/pi-extensions/workspace-input-status.ts.template +919 -0
- package/src/program.ts +112 -0
- package/src/scripts/workspace-table.py +394 -0
- package/src/types/dashboard.ts +29 -0
- package/src/types/index.ts +109 -0
- package/src/types/ink.d.ts +171 -0
- package/src/utils/agent-config.test.ts +303 -0
- package/src/utils/agent-config.ts +264 -0
- package/src/utils/agent-state.test.ts +166 -0
- package/src/utils/agent-state.ts +135 -0
- package/src/utils/banner.ts +24 -0
- package/src/utils/branch-operations.ts +237 -0
- package/src/utils/bug-report.test.ts +174 -0
- package/src/utils/bug-report.ts +355 -0
- package/src/utils/cache.ts +150 -0
- package/src/utils/claude-integration.test.ts +381 -0
- package/src/utils/claude-integration.ts +649 -0
- package/src/utils/claude-sessions.test.ts +262 -0
- package/src/utils/claude-sessions.ts +251 -0
- package/src/utils/cleanup-operations.ts +94 -0
- package/src/utils/colors.ts +25 -0
- package/src/utils/command-helpers.ts +46 -0
- package/src/utils/config.test.ts +203 -0
- package/src/utils/config.ts +133 -0
- package/src/utils/context-file.ts +36 -0
- package/src/utils/dashboard-hooks.test.ts +168 -0
- package/src/utils/dashboard-hooks.ts +163 -0
- package/src/utils/dependency-analyzer.ts +243 -0
- package/src/utils/diff-operations.ts +59 -0
- package/src/utils/doc-generator.ts +187 -0
- package/src/utils/ghq-integration.test.ts +195 -0
- package/src/utils/ghq-integration.ts +317 -0
- package/src/utils/git-operations.test.ts +265 -0
- package/src/utils/git-operations.ts +233 -0
- package/src/utils/git-status.ts +171 -0
- package/src/utils/github.ts +74 -0
- package/src/utils/health-checks.ts +359 -0
- package/src/utils/history.ts +140 -0
- package/src/utils/hooks.ts +92 -0
- package/src/utils/logger.ts +37 -0
- package/src/utils/permission-sync.test.ts +593 -0
- package/src/utils/permission-sync.ts +720 -0
- package/src/utils/pi-extensions.test.ts +182 -0
- package/src/utils/pi-extensions.ts +226 -0
- package/src/utils/progress.ts +73 -0
- package/src/utils/prompts.test.ts +169 -0
- package/src/utils/prompts.ts +296 -0
- package/src/utils/repo-resolver.test.ts +313 -0
- package/src/utils/repo-resolver.ts +294 -0
- package/src/utils/retry.test.ts +124 -0
- package/src/utils/retry.ts +85 -0
- package/src/utils/run-operations.ts +38 -0
- package/src/utils/suite.test.ts +256 -0
- package/src/utils/suite.ts +144 -0
- package/src/utils/sync-operations.ts +87 -0
- package/src/utils/tmux-dashboard.ts +193 -0
- package/src/utils/validation.test.ts +139 -0
- package/src/utils/validation.ts +128 -0
- package/src/utils/version-check.test.ts +108 -0
- package/src/utils/version-check.ts +96 -0
- package/src/utils/workspace-meta.ts +173 -0
- package/sync-permissions.sh +137 -0
- package/tsconfig.json +20 -0
- package/uninstall.sh +162 -0
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.registerCacheCommands = registerCacheCommands;
|
|
37
|
+
const command_helpers_1 = require("../../utils/command-helpers");
|
|
38
|
+
function registerCacheCommands(parent) {
|
|
39
|
+
const cache = parent
|
|
40
|
+
.command('cache')
|
|
41
|
+
.description('Cache management');
|
|
42
|
+
cache
|
|
43
|
+
.command('info')
|
|
44
|
+
.description('View cache statistics')
|
|
45
|
+
.action(async () => {
|
|
46
|
+
const { cacheInfo } = await Promise.resolve().then(() => __importStar(require('./manager')));
|
|
47
|
+
await cacheInfo();
|
|
48
|
+
});
|
|
49
|
+
cache
|
|
50
|
+
.command('refresh')
|
|
51
|
+
.description('Force refresh from GitHub')
|
|
52
|
+
.action(async () => {
|
|
53
|
+
const { cacheRefresh } = await Promise.resolve().then(() => __importStar(require('./manager')));
|
|
54
|
+
await cacheRefresh();
|
|
55
|
+
});
|
|
56
|
+
cache
|
|
57
|
+
.command('clear')
|
|
58
|
+
.description('Clear the cache')
|
|
59
|
+
.action(async () => {
|
|
60
|
+
const { cacheClear } = await Promise.resolve().then(() => __importStar(require('./manager')));
|
|
61
|
+
await cacheClear();
|
|
62
|
+
});
|
|
63
|
+
cache
|
|
64
|
+
.command('search')
|
|
65
|
+
.description('Search org repos by name or description')
|
|
66
|
+
.argument('<query>', 'Search query')
|
|
67
|
+
.option('--limit <n>', 'Max results', '20')
|
|
68
|
+
.action(async (query, opts) => {
|
|
69
|
+
const { cacheSearch } = await Promise.resolve().then(() => __importStar(require('./manager')));
|
|
70
|
+
await cacheSearch(query, parseInt(opts.limit) || 20);
|
|
71
|
+
});
|
|
72
|
+
cache
|
|
73
|
+
.command('list')
|
|
74
|
+
.description('List all org repos')
|
|
75
|
+
.action(async (opts, cmd) => {
|
|
76
|
+
const globalOpts = (0, command_helpers_1.getGlobalOpts)(cmd);
|
|
77
|
+
const { cacheList } = await Promise.resolve().then(() => __importStar(require('./manager')));
|
|
78
|
+
await cacheList(globalOpts.forceRefresh);
|
|
79
|
+
});
|
|
80
|
+
}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
#!/usr/bin/env ts-node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.cacheInfo = cacheInfo;
|
|
41
|
+
exports.cacheRefresh = cacheRefresh;
|
|
42
|
+
exports.cacheClear = cacheClear;
|
|
43
|
+
exports.cacheSearch = cacheSearch;
|
|
44
|
+
exports.cacheList = cacheList;
|
|
45
|
+
exports.main = main;
|
|
46
|
+
const cache_1 = require("../../utils/cache");
|
|
47
|
+
const github_1 = require("../../utils/github");
|
|
48
|
+
const logger_1 = require("../../utils/logger");
|
|
49
|
+
const colors_1 = require("../../utils/colors");
|
|
50
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
51
|
+
const fuzzy = __importStar(require("fuzzy"));
|
|
52
|
+
async function cacheInfo() {
|
|
53
|
+
const stats = await (0, cache_1.getCacheStats)();
|
|
54
|
+
if (stats.exists) {
|
|
55
|
+
console.log('\n' + (0, colors_1.colorize)('Cache Information:', 'cyan'));
|
|
56
|
+
console.log(` Status: ${(0, colors_1.colorize)('Active', 'green')}`);
|
|
57
|
+
console.log(` Repositories: ${(0, colors_1.colorize)(String(stats.repoCount), 'cyan')}`);
|
|
58
|
+
console.log(` Last updated: ${stats.age}`);
|
|
59
|
+
console.log(` Cache size: ${(0, colors_1.colorize)(String(Math.round((stats.size || 0) / 1024)) + ' KB', 'yellow')}`);
|
|
60
|
+
console.log(` Location: ${(0, colors_1.colorize)('~/.workspace-manager-cache/repos-cache.json', 'gray')}`);
|
|
61
|
+
}
|
|
62
|
+
else {
|
|
63
|
+
console.log('\n' + (0, colors_1.colorize)('Cache Status:', 'yellow'));
|
|
64
|
+
console.log(' No cache found. Cache will be created on next repository fetch.\n');
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async function cacheRefresh() {
|
|
68
|
+
const isAuthenticated = await (0, github_1.verifyGhAuth)();
|
|
69
|
+
if (!isAuthenticated) {
|
|
70
|
+
(0, logger_1.logError)('GitHub CLI is not authenticated');
|
|
71
|
+
(0, github_1.displayAuthInstructions)();
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
(0, logger_1.logInfo)('Forcing cache refresh...');
|
|
75
|
+
const repos = await (0, github_1.fetchOrgRepos)({ forceRefresh: true });
|
|
76
|
+
(0, logger_1.logSuccess)(`Cache refreshed with ${(0, colors_1.colorize)(String(repos.length), 'cyan')} repositories`);
|
|
77
|
+
}
|
|
78
|
+
async function cacheClear() {
|
|
79
|
+
await (0, cache_1.clearCache)();
|
|
80
|
+
(0, logger_1.logSuccess)('Cache cleared successfully');
|
|
81
|
+
}
|
|
82
|
+
async function cacheSearch(query, limit = 20) {
|
|
83
|
+
if (!query || query.trim().length === 0) {
|
|
84
|
+
(0, logger_1.logError)('Usage: w cache search <query>');
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
const allRepos = await (0, github_1.fetchOrgRepos)();
|
|
88
|
+
const results = fuzzy.filter(query, allRepos, {
|
|
89
|
+
extract: (repo) => `${repo.name} ${repo.description || ''}`,
|
|
90
|
+
});
|
|
91
|
+
const matches = results.slice(0, limit);
|
|
92
|
+
if (matches.length === 0) {
|
|
93
|
+
(0, logger_1.logInfo)(`No repositories matching '${query}'`);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
console.log('\n' + (0, colors_1.colorize)(`Search results for "${query}" (${matches.length} matches):`, 'cyan') + '\n');
|
|
97
|
+
for (const match of matches) {
|
|
98
|
+
const repo = match.original;
|
|
99
|
+
const visibility = repo.isPrivate ? (0, colors_1.colorize)('private', 'yellow') : (0, colors_1.colorize)('public', 'green');
|
|
100
|
+
console.log(` ${(0, colors_1.colorize)(repo.name, 'bright')} [${visibility}]`);
|
|
101
|
+
if (repo.description) {
|
|
102
|
+
console.log(` ${(0, colors_1.colorize)(repo.description, 'gray')}`);
|
|
103
|
+
}
|
|
104
|
+
console.log(` ${(0, colors_1.colorize)(repo.url, 'gray')}`);
|
|
105
|
+
}
|
|
106
|
+
console.log('');
|
|
107
|
+
}
|
|
108
|
+
async function cacheList(forceRefresh = false) {
|
|
109
|
+
const isAuthenticated = await (0, github_1.verifyGhAuth)();
|
|
110
|
+
if (!isAuthenticated) {
|
|
111
|
+
(0, logger_1.logError)('GitHub CLI is not authenticated');
|
|
112
|
+
(0, github_1.displayAuthInstructions)();
|
|
113
|
+
process.exit(1);
|
|
114
|
+
}
|
|
115
|
+
if (forceRefresh) {
|
|
116
|
+
(0, logger_1.logInfo)('Forcing cache refresh...');
|
|
117
|
+
}
|
|
118
|
+
const repos = await (0, github_1.fetchOrgRepos)({ forceRefresh });
|
|
119
|
+
if (repos.length === 0) {
|
|
120
|
+
(0, logger_1.logInfo)('No repositories found');
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
console.log('\n' + (0, colors_1.colorize)(`Organization repositories (${repos.length} total):`, 'cyan') + '\n');
|
|
124
|
+
for (const repo of repos) {
|
|
125
|
+
const visibility = repo.isPrivate ? (0, colors_1.colorize)('private', 'yellow') : (0, colors_1.colorize)('public', 'green');
|
|
126
|
+
console.log(` ${(0, colors_1.colorize)(repo.name, 'bright')} [${visibility}]`);
|
|
127
|
+
if (repo.description) {
|
|
128
|
+
console.log(` ${(0, colors_1.colorize)(repo.description, 'gray')}`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
console.log('');
|
|
132
|
+
(0, logger_1.logInfo)(`Showing ${repos.length} repositories. Use 'w cache search <query>' to filter.`);
|
|
133
|
+
}
|
|
134
|
+
async function main() {
|
|
135
|
+
console.log('\n' + '='.repeat(60));
|
|
136
|
+
console.log((0, colors_1.colorize)('Cache Manager', 'bright'));
|
|
137
|
+
console.log('='.repeat(60) + '\n');
|
|
138
|
+
try {
|
|
139
|
+
// Support direct subcommand invocation (e.g. from cache-router)
|
|
140
|
+
const action = process.argv[2];
|
|
141
|
+
if (action === 'info' || action === 'refresh' || action === 'clear') {
|
|
142
|
+
if (action === 'info') {
|
|
143
|
+
await cacheInfo();
|
|
144
|
+
}
|
|
145
|
+
else if (action === 'refresh') {
|
|
146
|
+
await cacheRefresh();
|
|
147
|
+
}
|
|
148
|
+
else if (action === 'clear') {
|
|
149
|
+
await cacheClear();
|
|
150
|
+
}
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
// Interactive mode (original behavior)
|
|
154
|
+
const { selectedAction } = await inquirer_1.default.prompt([
|
|
155
|
+
{
|
|
156
|
+
type: 'list',
|
|
157
|
+
name: 'selectedAction',
|
|
158
|
+
message: 'Select action:',
|
|
159
|
+
choices: [
|
|
160
|
+
{ name: 'View cache info', value: 'info' },
|
|
161
|
+
{ name: 'Refresh cache (force fetch from GitHub)', value: 'refresh' },
|
|
162
|
+
{ name: 'Clear cache', value: 'clear' },
|
|
163
|
+
],
|
|
164
|
+
},
|
|
165
|
+
]);
|
|
166
|
+
if (selectedAction === 'info') {
|
|
167
|
+
await cacheInfo();
|
|
168
|
+
}
|
|
169
|
+
else if (selectedAction === 'refresh') {
|
|
170
|
+
await cacheRefresh();
|
|
171
|
+
}
|
|
172
|
+
else if (selectedAction === 'clear') {
|
|
173
|
+
const { confirmed } = await inquirer_1.default.prompt([
|
|
174
|
+
{
|
|
175
|
+
type: 'confirm',
|
|
176
|
+
name: 'confirmed',
|
|
177
|
+
message: 'Are you sure you want to clear the cache?',
|
|
178
|
+
default: false,
|
|
179
|
+
},
|
|
180
|
+
]);
|
|
181
|
+
if (confirmed) {
|
|
182
|
+
await cacheClear();
|
|
183
|
+
}
|
|
184
|
+
else {
|
|
185
|
+
(0, logger_1.logInfo)('Cache clear cancelled');
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
(0, logger_1.logError)('Failed to manage cache');
|
|
191
|
+
if (error instanceof Error) {
|
|
192
|
+
(0, logger_1.logError)(error.message);
|
|
193
|
+
}
|
|
194
|
+
process.exit(1);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (require.main === module)
|
|
198
|
+
main();
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.registerCleanupCommand = registerCleanupCommand;
|
|
40
|
+
const path = __importStar(require("path"));
|
|
41
|
+
const config_1 = require("../utils/config");
|
|
42
|
+
const workspace_meta_1 = require("../utils/workspace-meta");
|
|
43
|
+
const cleanup_operations_1 = require("../utils/cleanup-operations");
|
|
44
|
+
const logger_1 = require("../utils/logger");
|
|
45
|
+
const colors_1 = require("../utils/colors");
|
|
46
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
47
|
+
const command_helpers_1 = require("../utils/command-helpers");
|
|
48
|
+
function registerCleanupCommand(parent) {
|
|
49
|
+
parent
|
|
50
|
+
.command('cleanup')
|
|
51
|
+
.alias('cl')
|
|
52
|
+
.description('Remove node_modules and build artifacts')
|
|
53
|
+
.argument('[workspace]', 'Workspace name')
|
|
54
|
+
.option('--all', 'Clean everything')
|
|
55
|
+
.option('--node-modules', 'Clean node_modules')
|
|
56
|
+
.option('--build', 'Clean build artifacts')
|
|
57
|
+
.option('--git-clean', 'Git clean (remove untracked files)')
|
|
58
|
+
.action(async (workspace, opts, cmd) => {
|
|
59
|
+
const globalOpts = (0, command_helpers_1.getGlobalOpts)(cmd);
|
|
60
|
+
await handleCleanup(workspace, { ...opts, ...globalOpts });
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async function handleCleanup(workspaceArg, opts) {
|
|
64
|
+
try {
|
|
65
|
+
const workspaceName = await (0, command_helpers_1.resolveWorkspace)(workspaceArg);
|
|
66
|
+
const workspacePath = path.join(config_1.WORKSPACES_DIR, workspaceName);
|
|
67
|
+
const metadata = await (0, workspace_meta_1.loadMetadata)(workspacePath);
|
|
68
|
+
if (!metadata) {
|
|
69
|
+
(0, logger_1.logError)(`Workspace not found: ${workspaceName}`);
|
|
70
|
+
process.exit(1);
|
|
71
|
+
}
|
|
72
|
+
const nodeModules = opts.nodeModules || opts.all;
|
|
73
|
+
const build = opts.build || opts.all;
|
|
74
|
+
const gitCleanFlag = opts.gitClean || opts.all;
|
|
75
|
+
let operations;
|
|
76
|
+
if (nodeModules || build || gitCleanFlag) {
|
|
77
|
+
operations = [];
|
|
78
|
+
if (nodeModules)
|
|
79
|
+
operations.push('node_modules');
|
|
80
|
+
if (build)
|
|
81
|
+
operations.push('build');
|
|
82
|
+
if (gitCleanFlag)
|
|
83
|
+
operations.push('git_clean');
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
const result = await inquirer_1.default.prompt([
|
|
87
|
+
{
|
|
88
|
+
type: 'checkbox',
|
|
89
|
+
name: 'operations',
|
|
90
|
+
message: 'Select cleanup operations:',
|
|
91
|
+
choices: [
|
|
92
|
+
{ name: 'Remove node_modules (all repos)', value: 'node_modules' },
|
|
93
|
+
{ name: 'Remove build artifacts (dist, build, .next, coverage)', value: 'build' },
|
|
94
|
+
{ name: 'Git clean (remove untracked files)', value: 'git_clean' },
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
]);
|
|
98
|
+
operations = result.operations;
|
|
99
|
+
}
|
|
100
|
+
if (operations.length === 0) {
|
|
101
|
+
(0, logger_1.logInfo)('No operations selected');
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
if (!opts.yes) {
|
|
105
|
+
const { confirm } = await inquirer_1.default.prompt([
|
|
106
|
+
{
|
|
107
|
+
type: 'confirm',
|
|
108
|
+
name: 'confirm',
|
|
109
|
+
message: `Proceed with cleanup? This cannot be undone.`,
|
|
110
|
+
default: false,
|
|
111
|
+
},
|
|
112
|
+
]);
|
|
113
|
+
if (!confirm) {
|
|
114
|
+
(0, logger_1.logInfo)('Cleanup cancelled');
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
(0, logger_1.logStep)('Running cleanup operations...');
|
|
119
|
+
for (const repo of metadata.repositories) {
|
|
120
|
+
const repoPath = path.join(workspacePath, repo.directoryName);
|
|
121
|
+
const displayName = repo.directoryName !== repo.name
|
|
122
|
+
? `${repo.directoryName} (${repo.name})`
|
|
123
|
+
: repo.name;
|
|
124
|
+
console.log(`\n${(0, colors_1.colorize)(displayName, 'cyan')}:`);
|
|
125
|
+
if (operations.includes('node_modules')) {
|
|
126
|
+
const result = await (0, cleanup_operations_1.removeNodeModules)(repoPath);
|
|
127
|
+
if (result.success) {
|
|
128
|
+
(0, logger_1.logSuccess)(` Removed node_modules (${result.spaceFreed})`);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
if (operations.includes('build')) {
|
|
132
|
+
const result = await (0, cleanup_operations_1.removeBuildArtifacts)(repoPath);
|
|
133
|
+
if (result.success && result.filesRemoved > 0) {
|
|
134
|
+
(0, logger_1.logSuccess)(` Removed ${result.filesRemoved} build artifacts (${result.spaceFreed})`);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
if (operations.includes('git_clean')) {
|
|
138
|
+
const result = await (0, cleanup_operations_1.gitClean)(repoPath, false);
|
|
139
|
+
if (result.success && result.filesRemoved > 0) {
|
|
140
|
+
(0, logger_1.logSuccess)(` Git clean: removed ${result.filesRemoved} files`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
(0, logger_1.logSuccess)('\nCleanup completed!');
|
|
145
|
+
}
|
|
146
|
+
catch (error) {
|
|
147
|
+
(0, logger_1.logError)('Cleanup failed');
|
|
148
|
+
if (error instanceof Error) {
|
|
149
|
+
(0, logger_1.logError)(error.message);
|
|
150
|
+
}
|
|
151
|
+
process.exit(1);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.registerConfigureClaudeCommand = registerConfigureClaudeCommand;
|
|
7
|
+
const claude_integration_1 = require("../utils/claude-integration");
|
|
8
|
+
const logger_1 = require("../utils/logger");
|
|
9
|
+
const colors_1 = require("../utils/colors");
|
|
10
|
+
const inquirer_1 = __importDefault(require("inquirer"));
|
|
11
|
+
function registerConfigureClaudeCommand(parent) {
|
|
12
|
+
parent
|
|
13
|
+
.command('configure-claude')
|
|
14
|
+
.alias('cc')
|
|
15
|
+
.description('Configure Claude Code integration')
|
|
16
|
+
.action(async () => {
|
|
17
|
+
await handleConfigureClaude();
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
async function handleConfigureClaude() {
|
|
21
|
+
console.log('\n' + '='.repeat(60));
|
|
22
|
+
console.log((0, colors_1.colorize)('Configure Claude Code Integration', 'bright'));
|
|
23
|
+
console.log('='.repeat(60) + '\n');
|
|
24
|
+
try {
|
|
25
|
+
const currentConfig = await (0, claude_integration_1.loadClaudeConfig)();
|
|
26
|
+
console.log('Current settings:');
|
|
27
|
+
console.log(` Auto-launch Claude: ${currentConfig.autoLaunch ? (0, colors_1.colorize)('Enabled', 'green') : (0, colors_1.colorize)('Disabled', 'red')}`);
|
|
28
|
+
console.log(` Generate context: ${currentConfig.generateContext ? (0, colors_1.colorize)('Enabled', 'green') : (0, colors_1.colorize)('Disabled', 'red')}`);
|
|
29
|
+
console.log('');
|
|
30
|
+
const answers = await inquirer_1.default.prompt([
|
|
31
|
+
{ type: 'confirm', name: 'autoLaunch', message: 'Auto-launch Claude Code after workspace creation?', default: currentConfig.autoLaunch },
|
|
32
|
+
{ type: 'confirm', name: 'generateContext', message: 'Generate CLAUDE.md context file in workspaces?', default: currentConfig.generateContext },
|
|
33
|
+
]);
|
|
34
|
+
await (0, claude_integration_1.saveClaudeConfig)(answers);
|
|
35
|
+
console.log('');
|
|
36
|
+
(0, logger_1.logSuccess)('Claude Code integration configured!');
|
|
37
|
+
console.log('');
|
|
38
|
+
console.log('Settings:');
|
|
39
|
+
console.log(` ${(0, colors_1.colorize)('✓', 'green')} Auto-launch: ${answers.autoLaunch ? 'Enabled' : 'Disabled'}`);
|
|
40
|
+
console.log(` ${(0, colors_1.colorize)('✓', 'green')} Generate context: ${answers.generateContext ? 'Enabled' : 'Disabled'}`);
|
|
41
|
+
if (answers.autoLaunch) {
|
|
42
|
+
console.log('');
|
|
43
|
+
console.log((0, colors_1.colorize)('Note:', 'yellow') + ' Claude Code will automatically launch when you create workspaces.');
|
|
44
|
+
console.log('Make sure Claude Code CLI is installed: https://claude.ai/download');
|
|
45
|
+
}
|
|
46
|
+
console.log('');
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
(0, logger_1.logError)('Failed to configure Claude integration');
|
|
50
|
+
if (error instanceof Error) {
|
|
51
|
+
(0, logger_1.logError)(error.message);
|
|
52
|
+
}
|
|
53
|
+
process.exit(1);
|
|
54
|
+
}
|
|
55
|
+
}
|