aman-intelligence 0.1.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/LICENSE +21 -0
- package/README.md +116 -0
- package/dist/bin/aman.d.ts +2 -0
- package/dist/bin/aman.js +165 -0
- package/dist/cli/global-install.d.ts +7 -0
- package/dist/cli/global-install.js +36 -0
- package/dist/cli/help-text.d.ts +1 -0
- package/dist/cli/help-text.js +62 -0
- package/dist/cli/version.d.ts +1 -0
- package/dist/cli/version.js +6 -0
- package/dist/commands/backup.d.ts +11 -0
- package/dist/commands/backup.js +262 -0
- package/dist/commands/browse.d.ts +11 -0
- package/dist/commands/browse.js +641 -0
- package/dist/commands/cache.d.ts +1 -0
- package/dist/commands/cache.js +38 -0
- package/dist/commands/config.d.ts +4 -0
- package/dist/commands/config.js +146 -0
- package/dist/commands/dashboard.d.ts +1 -0
- package/dist/commands/dashboard.js +1004 -0
- package/dist/commands/doctor.d.ts +4 -0
- package/dist/commands/doctor.js +54 -0
- package/dist/commands/export.d.ts +1 -0
- package/dist/commands/export.js +137 -0
- package/dist/commands/help.d.ts +1 -0
- package/dist/commands/help.js +47 -0
- package/dist/commands/import-wizard.d.ts +7 -0
- package/dist/commands/import-wizard.js +374 -0
- package/dist/commands/import.d.ts +9 -0
- package/dist/commands/import.js +351 -0
- package/dist/commands/info.d.ts +1 -0
- package/dist/commands/info.js +174 -0
- package/dist/commands/init.d.ts +20 -0
- package/dist/commands/init.js +146 -0
- package/dist/commands/install.d.ts +10 -0
- package/dist/commands/install.js +342 -0
- package/dist/commands/pack.d.ts +23 -0
- package/dist/commands/pack.js +331 -0
- package/dist/commands/registry.d.ts +6 -0
- package/dist/commands/registry.js +218 -0
- package/dist/commands/remove.d.ts +1 -0
- package/dist/commands/remove.js +76 -0
- package/dist/commands/search.d.ts +7 -0
- package/dist/commands/search.js +295 -0
- package/dist/commands/stack.d.ts +18 -0
- package/dist/commands/stack.js +327 -0
- package/dist/commands/sync.d.ts +9 -0
- package/dist/commands/sync.js +428 -0
- package/dist/commands/update.d.ts +1 -0
- package/dist/commands/update.js +97 -0
- package/dist/config/features.d.ts +2 -0
- package/dist/config/features.js +2 -0
- package/dist/config/index.d.ts +13 -0
- package/dist/config/index.js +80 -0
- package/dist/config/paths.d.ts +23 -0
- package/dist/config/paths.js +45 -0
- package/dist/import/adapters.d.ts +14 -0
- package/dist/import/adapters.js +580 -0
- package/dist/import/discovery.service.d.ts +8 -0
- package/dist/import/discovery.service.js +26 -0
- package/dist/import/import.service.d.ts +7 -0
- package/dist/import/import.service.js +259 -0
- package/dist/import/types.d.ts +71 -0
- package/dist/import/types.js +1 -0
- package/dist/import/utils.d.ts +36 -0
- package/dist/import/utils.js +428 -0
- package/dist/marketplace/cache.d.ts +18 -0
- package/dist/marketplace/cache.js +141 -0
- package/dist/marketplace/github-search.d.ts +17 -0
- package/dist/marketplace/github-search.js +268 -0
- package/dist/marketplace/install-from-candidate.d.ts +6 -0
- package/dist/marketplace/install-from-candidate.js +14 -0
- package/dist/marketplace/install.d.ts +15 -0
- package/dist/marketplace/install.js +54 -0
- package/dist/marketplace/metadata-validator.d.ts +8 -0
- package/dist/marketplace/metadata-validator.js +79 -0
- package/dist/marketplace/types.d.ts +34 -0
- package/dist/marketplace/types.js +1 -0
- package/dist/providers/local.provider.d.ts +9 -0
- package/dist/providers/local.provider.js +51 -0
- package/dist/providers/provider.interface.d.ts +7 -0
- package/dist/providers/provider.interface.js +1 -0
- package/dist/providers/registry.provider.d.ts +2 -0
- package/dist/providers/registry.provider.js +42 -0
- package/dist/providers/skills-sh.provider.d.ts +11 -0
- package/dist/providers/skills-sh.provider.js +56 -0
- package/dist/registry/adapter.interface.d.ts +16 -0
- package/dist/registry/adapter.interface.js +1 -0
- package/dist/registry/errors.d.ts +5 -0
- package/dist/registry/errors.js +8 -0
- package/dist/registry/filesystem-registry.adapter.d.ts +25 -0
- package/dist/registry/filesystem-registry.adapter.js +288 -0
- package/dist/registry/github-registry.adapter.d.ts +11 -0
- package/dist/registry/github-registry.adapter.js +32 -0
- package/dist/registry/index.d.ts +8 -0
- package/dist/registry/index.js +8 -0
- package/dist/registry/local-registry.adapter.d.ts +6 -0
- package/dist/registry/local-registry.adapter.js +9 -0
- package/dist/registry/registry.service.d.ts +44 -0
- package/dist/registry/registry.service.js +163 -0
- package/dist/registry/slug-utils.d.ts +12 -0
- package/dist/registry/slug-utils.js +51 -0
- package/dist/registry/types.d.ts +160 -0
- package/dist/registry/types.js +1 -0
- package/dist/services/asset.service.d.ts +12 -0
- package/dist/services/asset.service.js +142 -0
- package/dist/services/backup.service.d.ts +8 -0
- package/dist/services/backup.service.js +169 -0
- package/dist/services/classification.service.d.ts +31 -0
- package/dist/services/classification.service.js +271 -0
- package/dist/services/config.service.d.ts +9 -0
- package/dist/services/config.service.js +20 -0
- package/dist/services/doctor.service.d.ts +5 -0
- package/dist/services/doctor.service.js +186 -0
- package/dist/services/environment.service.d.ts +42 -0
- package/dist/services/environment.service.js +227 -0
- package/dist/services/github.service.d.ts +7 -0
- package/dist/services/github.service.js +42 -0
- package/dist/services/lock.service.d.ts +12 -0
- package/dist/services/lock.service.js +71 -0
- package/dist/services/marketplace.service.d.ts +40 -0
- package/dist/services/marketplace.service.js +225 -0
- package/dist/services/pack.service.d.ts +9 -0
- package/dist/services/pack.service.js +193 -0
- package/dist/services/stack.service.d.ts +9 -0
- package/dist/services/stack.service.js +94 -0
- package/dist/storage/asset-layout.d.ts +46 -0
- package/dist/storage/asset-layout.js +277 -0
- package/dist/storage/filesystem.d.ts +12 -0
- package/dist/storage/filesystem.js +113 -0
- package/dist/storage/scan-by-type.d.ts +2 -0
- package/dist/storage/scan-by-type.js +8 -0
- package/dist/storage/scanner.d.ts +11 -0
- package/dist/storage/scanner.js +188 -0
- package/dist/types/asset-metadata.d.ts +84 -0
- package/dist/types/asset-metadata.js +104 -0
- package/dist/types/index.d.ts +212 -0
- package/dist/types/index.js +1 -0
- package/dist/ui/animations/ErrorIndicator.d.ts +5 -0
- package/dist/ui/animations/ErrorIndicator.js +6 -0
- package/dist/ui/animations/GithubIndicator.d.ts +6 -0
- package/dist/ui/animations/GithubIndicator.js +9 -0
- package/dist/ui/animations/ProgressBar.d.ts +5 -0
- package/dist/ui/animations/ProgressBar.js +15 -0
- package/dist/ui/animations/Spinner.d.ts +5 -0
- package/dist/ui/animations/Spinner.js +21 -0
- package/dist/ui/animations/SuccessIndicator.d.ts +5 -0
- package/dist/ui/animations/SuccessIndicator.js +6 -0
- package/dist/ui/animations/SyncActivity.d.ts +5 -0
- package/dist/ui/animations/SyncActivity.js +21 -0
- package/dist/ui/animations/TransitionScreen.d.ts +7 -0
- package/dist/ui/animations/TransitionScreen.js +25 -0
- package/dist/ui/animations/useAnimationMode.d.ts +1 -0
- package/dist/ui/animations/useAnimationMode.js +16 -0
- package/dist/ui/assetDisplay.d.ts +19 -0
- package/dist/ui/assetDisplay.js +59 -0
- package/dist/ui/components/Confirm.d.ts +8 -0
- package/dist/ui/components/Confirm.js +14 -0
- package/dist/ui/components/CustomSelect.d.ts +19 -0
- package/dist/ui/components/CustomSelect.js +13 -0
- package/dist/ui/components/Header.d.ts +6 -0
- package/dist/ui/components/Header.js +9 -0
- package/dist/ui/components/HealthReport.d.ts +7 -0
- package/dist/ui/components/HealthReport.js +13 -0
- package/dist/ui/components/MarketplaceInstallConfirm.d.ts +19 -0
- package/dist/ui/components/MarketplaceInstallConfirm.js +23 -0
- package/dist/ui/components/Narrator.d.ts +9 -0
- package/dist/ui/components/Narrator.js +26 -0
- package/dist/ui/components/ScopePrompt.d.ts +8 -0
- package/dist/ui/components/ScopePrompt.js +23 -0
- package/dist/ui/components/TooSmallScreen.d.ts +8 -0
- package/dist/ui/components/TooSmallScreen.js +6 -0
- package/dist/ui/date.d.ts +2 -0
- package/dist/ui/date.js +33 -0
- package/dist/ui/layout.d.ts +23 -0
- package/dist/ui/layout.js +44 -0
- package/dist/ui/list-item.d.ts +12 -0
- package/dist/ui/list-item.js +1 -0
- package/dist/ui/marketplaceDisplay.d.ts +10 -0
- package/dist/ui/marketplaceDisplay.js +36 -0
- package/dist/ui/theme.d.ts +42 -0
- package/dist/ui/theme.js +47 -0
- package/dist/utils/asset-list-fields.d.ts +11 -0
- package/dist/utils/asset-list-fields.js +28 -0
- package/dist/utils/error-message.d.ts +2 -0
- package/dist/utils/error-message.js +6 -0
- package/dist/utils/integrity.d.ts +9 -0
- package/dist/utils/integrity.js +23 -0
- package/dist/utils/lock-migrate.d.ts +25 -0
- package/dist/utils/lock-migrate.js +93 -0
- package/dist/utils/mcp-local.d.ts +15 -0
- package/dist/utils/mcp-local.js +129 -0
- package/dist/utils/slug.d.ts +6 -0
- package/dist/utils/slug.js +13 -0
- package/dist/utils/stack-normalize.d.ts +3 -0
- package/dist/utils/stack-normalize.js +43 -0
- package/package.json +77 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { clearMarketplaceCache, getMarketplaceCacheStatus, MARKETPLACE_CACHE_DIR, } from '../marketplace/cache.js';
|
|
2
|
+
import { MARKETPLACE_ENABLED } from '../config/features.js';
|
|
3
|
+
export async function cacheCommand(args) {
|
|
4
|
+
if (!MARKETPLACE_ENABLED) {
|
|
5
|
+
console.log('\n Marketplace cache is not available yet (coming in a future release).\n');
|
|
6
|
+
return;
|
|
7
|
+
}
|
|
8
|
+
const sub = args[0] ?? 'status';
|
|
9
|
+
if (sub === 'clear') {
|
|
10
|
+
const removed = await clearMarketplaceCache();
|
|
11
|
+
console.log(`Cleared marketplace cache (${removed} entries).`);
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
if (sub === 'status') {
|
|
15
|
+
const status = await getMarketplaceCacheStatus();
|
|
16
|
+
console.log('\n Marketplace cache\n');
|
|
17
|
+
console.log(` Location: ${MARKETPLACE_CACHE_DIR}`);
|
|
18
|
+
console.log(` Entries: ${status.entryCount}`);
|
|
19
|
+
console.log(` Size: ${formatBytes(status.totalBytes)}`);
|
|
20
|
+
if (status.newestAgeMinutes !== null) {
|
|
21
|
+
console.log(` Newest entry: ${status.newestAgeMinutes} minutes ago`);
|
|
22
|
+
}
|
|
23
|
+
if (status.oldestAgeMinutes !== null) {
|
|
24
|
+
console.log(` Oldest entry: ${status.oldestAgeMinutes} minutes ago`);
|
|
25
|
+
}
|
|
26
|
+
console.log(' TTL: 1 hour\n');
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
console.log('Usage: aman cache <status|clear>');
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
function formatBytes(bytes) {
|
|
33
|
+
if (bytes < 1024)
|
|
34
|
+
return `${bytes} B`;
|
|
35
|
+
if (bytes < 1024 * 1024)
|
|
36
|
+
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
37
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
|
|
38
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { render, Box, Text, useApp, useInput } from 'ink';
|
|
4
|
+
import { CustomSelectInput } from '../ui/components/CustomSelect.js';
|
|
5
|
+
import { configService } from '../services/config.service.js';
|
|
6
|
+
import { theme } from '../ui/theme.js';
|
|
7
|
+
import { Header } from '../ui/components/Header.js';
|
|
8
|
+
import { Narrator } from '../ui/components/Narrator.js';
|
|
9
|
+
export const ConfigApp = ({ onBack }) => {
|
|
10
|
+
const { exit } = useApp();
|
|
11
|
+
const handleExit = () => {
|
|
12
|
+
if (onBack)
|
|
13
|
+
onBack();
|
|
14
|
+
else
|
|
15
|
+
exit();
|
|
16
|
+
};
|
|
17
|
+
const [mode, setMode] = useState('menu');
|
|
18
|
+
const [mochiState, setMochiState] = useState('searching');
|
|
19
|
+
const [message, setMessage] = useState('');
|
|
20
|
+
const [currentConfig, setCurrentConfig] = useState(configService.list());
|
|
21
|
+
useInput((input, key) => {
|
|
22
|
+
if (input === 'q' || key.escape)
|
|
23
|
+
handleExit();
|
|
24
|
+
});
|
|
25
|
+
const handleSelectSetting = (item) => {
|
|
26
|
+
if (item.value === 'quit') {
|
|
27
|
+
handleExit();
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (item.value === 'reset') {
|
|
31
|
+
setMode('resetting');
|
|
32
|
+
setMochiState('installing');
|
|
33
|
+
setMessage('Resetting configuration to defaults...');
|
|
34
|
+
setTimeout(() => {
|
|
35
|
+
configService.reset();
|
|
36
|
+
setCurrentConfig(configService.list());
|
|
37
|
+
setMochiState('success');
|
|
38
|
+
setMessage('Configuration reset successfully!');
|
|
39
|
+
setMode('done');
|
|
40
|
+
setTimeout(() => handleExit(), 1000);
|
|
41
|
+
}, 800);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
// Toggle values in place
|
|
45
|
+
if (item.value === 'theme') {
|
|
46
|
+
const nextTheme = currentConfig.theme === 'auto' ? 'dark' : currentConfig.theme === 'dark' ? 'light' : 'auto';
|
|
47
|
+
configService.set('theme', nextTheme);
|
|
48
|
+
setCurrentConfig(configService.list());
|
|
49
|
+
}
|
|
50
|
+
else if (item.value === 'defaultScope') {
|
|
51
|
+
const nextScope = currentConfig.defaultScope === 'global' ? 'project' : 'global';
|
|
52
|
+
configService.set('defaultScope', nextScope);
|
|
53
|
+
setCurrentConfig(configService.list());
|
|
54
|
+
}
|
|
55
|
+
else if (item.value === 'animationMode') {
|
|
56
|
+
const currentMode = currentConfig.animationMode || 'normal';
|
|
57
|
+
const nextMode = currentMode === 'off' ? 'reduced' : currentMode === 'reduced' ? 'normal' : 'off';
|
|
58
|
+
configService.set('animationMode', nextMode);
|
|
59
|
+
setCurrentConfig(configService.list());
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (mode === 'resetting' || mode === 'done') {
|
|
63
|
+
return (_jsx(Box, { flexDirection: "column", paddingX: 1, children: _jsx(Narrator, { state: mochiState, message: message }) }));
|
|
64
|
+
}
|
|
65
|
+
const storageStr = currentConfig.storage
|
|
66
|
+
? `${currentConfig.storage.type}${currentConfig.storage.repository ? ` (${currentConfig.storage.repository})` : ''}`
|
|
67
|
+
: 'not initialized';
|
|
68
|
+
const menuItems = [
|
|
69
|
+
{ label: `Theme: ${currentConfig.theme}`, value: 'theme' },
|
|
70
|
+
{ label: `Default Scope: ${currentConfig.defaultScope}`, value: 'defaultScope' },
|
|
71
|
+
{ label: `Animations: ${currentConfig.animationMode || 'normal'}`, value: 'animationMode' },
|
|
72
|
+
{ label: 'Reset Configuration', value: 'reset' },
|
|
73
|
+
{ label: onBack ? 'Back to Main Menu' : 'Save & Exit', value: 'quit' },
|
|
74
|
+
];
|
|
75
|
+
return (_jsxs(Box, { flexDirection: "column", paddingX: 1, children: [_jsx(Header, { compact: true }), _jsx(Text, { bold: true, color: theme.accent, children: "Settings" }), _jsxs(Box, { flexDirection: "column", marginTop: 1, children: [_jsxs(Text, { color: theme.dim, children: ["Environment: ", currentConfig.environmentPath || '~/.aman'] }), _jsxs(Text, { color: theme.dim, children: ["Storage: ", storageStr] })] }), _jsx(Box, { marginTop: 1, children: _jsx(CustomSelectInput, { items: menuItems, onSelect: handleSelectSetting }) })] }));
|
|
76
|
+
};
|
|
77
|
+
export async function configCommand(args) {
|
|
78
|
+
const subcmd = args[0];
|
|
79
|
+
if (!subcmd) {
|
|
80
|
+
if (!process.stdin.isTTY) {
|
|
81
|
+
await configCommand(['list']);
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const { waitUntilExit } = render(_jsx(ConfigApp, {}));
|
|
85
|
+
await waitUntilExit();
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
if (subcmd === 'list') {
|
|
89
|
+
const data = configService.list();
|
|
90
|
+
console.log(`\n \x1b[38;2;255;157;35mAman Configuration:\x1b[0m`);
|
|
91
|
+
console.log(` theme: ${data.theme}`);
|
|
92
|
+
console.log(` defaultScope: ${data.defaultScope}`);
|
|
93
|
+
console.log(` envPath: ${data.environmentPath || 'default (~/.aman)'}`);
|
|
94
|
+
console.log(` storage: ${data.storage ? data.storage.type : 'local'}`);
|
|
95
|
+
console.log(` animations: ${data.animationMode || 'normal'}\n`);
|
|
96
|
+
}
|
|
97
|
+
else if (subcmd === 'get') {
|
|
98
|
+
const key = args[1];
|
|
99
|
+
if (!key) {
|
|
100
|
+
console.log(' Usage: aman config get <key>');
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const val = configService.get(key);
|
|
104
|
+
if (typeof val === 'object' && val !== null) {
|
|
105
|
+
console.log(JSON.stringify(val, null, 2));
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
console.log(val);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
else if (subcmd === 'set') {
|
|
112
|
+
const key = args[1];
|
|
113
|
+
const value = args[2];
|
|
114
|
+
if (!key || value === undefined) {
|
|
115
|
+
console.log(' Usage: aman config set <key> <value>');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
let parsedValue = value;
|
|
119
|
+
if (value === 'true')
|
|
120
|
+
parsedValue = true;
|
|
121
|
+
else if (value === 'false')
|
|
122
|
+
parsedValue = false;
|
|
123
|
+
else if (!isNaN(Number(value)))
|
|
124
|
+
parsedValue = Number(value);
|
|
125
|
+
// Support nested keys or structure if needed, otherwise direct
|
|
126
|
+
if (key === 'animations' || key === 'animationMode') {
|
|
127
|
+
let mode = parsedValue;
|
|
128
|
+
if (parsedValue === true)
|
|
129
|
+
mode = 'normal';
|
|
130
|
+
if (parsedValue === false)
|
|
131
|
+
mode = 'off';
|
|
132
|
+
configService.set('animationMode', mode);
|
|
133
|
+
}
|
|
134
|
+
else {
|
|
135
|
+
configService.set(key, parsedValue);
|
|
136
|
+
}
|
|
137
|
+
console.log(` ✓ Set ${key} → ${parsedValue}`);
|
|
138
|
+
}
|
|
139
|
+
else if (subcmd === 'reset') {
|
|
140
|
+
configService.reset();
|
|
141
|
+
console.log(' ✓ Configuration reset to defaults.');
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
console.log(' Unknown config command. Use: list, get, set, reset, or run "aman config" for interactive mode.');
|
|
145
|
+
}
|
|
146
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function dashboardCommand(): Promise<void>;
|