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.
Files changed (197) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +116 -0
  3. package/dist/bin/aman.d.ts +2 -0
  4. package/dist/bin/aman.js +165 -0
  5. package/dist/cli/global-install.d.ts +7 -0
  6. package/dist/cli/global-install.js +36 -0
  7. package/dist/cli/help-text.d.ts +1 -0
  8. package/dist/cli/help-text.js +62 -0
  9. package/dist/cli/version.d.ts +1 -0
  10. package/dist/cli/version.js +6 -0
  11. package/dist/commands/backup.d.ts +11 -0
  12. package/dist/commands/backup.js +262 -0
  13. package/dist/commands/browse.d.ts +11 -0
  14. package/dist/commands/browse.js +641 -0
  15. package/dist/commands/cache.d.ts +1 -0
  16. package/dist/commands/cache.js +38 -0
  17. package/dist/commands/config.d.ts +4 -0
  18. package/dist/commands/config.js +146 -0
  19. package/dist/commands/dashboard.d.ts +1 -0
  20. package/dist/commands/dashboard.js +1004 -0
  21. package/dist/commands/doctor.d.ts +4 -0
  22. package/dist/commands/doctor.js +54 -0
  23. package/dist/commands/export.d.ts +1 -0
  24. package/dist/commands/export.js +137 -0
  25. package/dist/commands/help.d.ts +1 -0
  26. package/dist/commands/help.js +47 -0
  27. package/dist/commands/import-wizard.d.ts +7 -0
  28. package/dist/commands/import-wizard.js +374 -0
  29. package/dist/commands/import.d.ts +9 -0
  30. package/dist/commands/import.js +351 -0
  31. package/dist/commands/info.d.ts +1 -0
  32. package/dist/commands/info.js +174 -0
  33. package/dist/commands/init.d.ts +20 -0
  34. package/dist/commands/init.js +146 -0
  35. package/dist/commands/install.d.ts +10 -0
  36. package/dist/commands/install.js +342 -0
  37. package/dist/commands/pack.d.ts +23 -0
  38. package/dist/commands/pack.js +331 -0
  39. package/dist/commands/registry.d.ts +6 -0
  40. package/dist/commands/registry.js +218 -0
  41. package/dist/commands/remove.d.ts +1 -0
  42. package/dist/commands/remove.js +76 -0
  43. package/dist/commands/search.d.ts +7 -0
  44. package/dist/commands/search.js +295 -0
  45. package/dist/commands/stack.d.ts +18 -0
  46. package/dist/commands/stack.js +327 -0
  47. package/dist/commands/sync.d.ts +9 -0
  48. package/dist/commands/sync.js +428 -0
  49. package/dist/commands/update.d.ts +1 -0
  50. package/dist/commands/update.js +97 -0
  51. package/dist/config/features.d.ts +2 -0
  52. package/dist/config/features.js +2 -0
  53. package/dist/config/index.d.ts +13 -0
  54. package/dist/config/index.js +80 -0
  55. package/dist/config/paths.d.ts +23 -0
  56. package/dist/config/paths.js +45 -0
  57. package/dist/import/adapters.d.ts +14 -0
  58. package/dist/import/adapters.js +580 -0
  59. package/dist/import/discovery.service.d.ts +8 -0
  60. package/dist/import/discovery.service.js +26 -0
  61. package/dist/import/import.service.d.ts +7 -0
  62. package/dist/import/import.service.js +259 -0
  63. package/dist/import/types.d.ts +71 -0
  64. package/dist/import/types.js +1 -0
  65. package/dist/import/utils.d.ts +36 -0
  66. package/dist/import/utils.js +428 -0
  67. package/dist/marketplace/cache.d.ts +18 -0
  68. package/dist/marketplace/cache.js +141 -0
  69. package/dist/marketplace/github-search.d.ts +17 -0
  70. package/dist/marketplace/github-search.js +268 -0
  71. package/dist/marketplace/install-from-candidate.d.ts +6 -0
  72. package/dist/marketplace/install-from-candidate.js +14 -0
  73. package/dist/marketplace/install.d.ts +15 -0
  74. package/dist/marketplace/install.js +54 -0
  75. package/dist/marketplace/metadata-validator.d.ts +8 -0
  76. package/dist/marketplace/metadata-validator.js +79 -0
  77. package/dist/marketplace/types.d.ts +34 -0
  78. package/dist/marketplace/types.js +1 -0
  79. package/dist/providers/local.provider.d.ts +9 -0
  80. package/dist/providers/local.provider.js +51 -0
  81. package/dist/providers/provider.interface.d.ts +7 -0
  82. package/dist/providers/provider.interface.js +1 -0
  83. package/dist/providers/registry.provider.d.ts +2 -0
  84. package/dist/providers/registry.provider.js +42 -0
  85. package/dist/providers/skills-sh.provider.d.ts +11 -0
  86. package/dist/providers/skills-sh.provider.js +56 -0
  87. package/dist/registry/adapter.interface.d.ts +16 -0
  88. package/dist/registry/adapter.interface.js +1 -0
  89. package/dist/registry/errors.d.ts +5 -0
  90. package/dist/registry/errors.js +8 -0
  91. package/dist/registry/filesystem-registry.adapter.d.ts +25 -0
  92. package/dist/registry/filesystem-registry.adapter.js +288 -0
  93. package/dist/registry/github-registry.adapter.d.ts +11 -0
  94. package/dist/registry/github-registry.adapter.js +32 -0
  95. package/dist/registry/index.d.ts +8 -0
  96. package/dist/registry/index.js +8 -0
  97. package/dist/registry/local-registry.adapter.d.ts +6 -0
  98. package/dist/registry/local-registry.adapter.js +9 -0
  99. package/dist/registry/registry.service.d.ts +44 -0
  100. package/dist/registry/registry.service.js +163 -0
  101. package/dist/registry/slug-utils.d.ts +12 -0
  102. package/dist/registry/slug-utils.js +51 -0
  103. package/dist/registry/types.d.ts +160 -0
  104. package/dist/registry/types.js +1 -0
  105. package/dist/services/asset.service.d.ts +12 -0
  106. package/dist/services/asset.service.js +142 -0
  107. package/dist/services/backup.service.d.ts +8 -0
  108. package/dist/services/backup.service.js +169 -0
  109. package/dist/services/classification.service.d.ts +31 -0
  110. package/dist/services/classification.service.js +271 -0
  111. package/dist/services/config.service.d.ts +9 -0
  112. package/dist/services/config.service.js +20 -0
  113. package/dist/services/doctor.service.d.ts +5 -0
  114. package/dist/services/doctor.service.js +186 -0
  115. package/dist/services/environment.service.d.ts +42 -0
  116. package/dist/services/environment.service.js +227 -0
  117. package/dist/services/github.service.d.ts +7 -0
  118. package/dist/services/github.service.js +42 -0
  119. package/dist/services/lock.service.d.ts +12 -0
  120. package/dist/services/lock.service.js +71 -0
  121. package/dist/services/marketplace.service.d.ts +40 -0
  122. package/dist/services/marketplace.service.js +225 -0
  123. package/dist/services/pack.service.d.ts +9 -0
  124. package/dist/services/pack.service.js +193 -0
  125. package/dist/services/stack.service.d.ts +9 -0
  126. package/dist/services/stack.service.js +94 -0
  127. package/dist/storage/asset-layout.d.ts +46 -0
  128. package/dist/storage/asset-layout.js +277 -0
  129. package/dist/storage/filesystem.d.ts +12 -0
  130. package/dist/storage/filesystem.js +113 -0
  131. package/dist/storage/scan-by-type.d.ts +2 -0
  132. package/dist/storage/scan-by-type.js +8 -0
  133. package/dist/storage/scanner.d.ts +11 -0
  134. package/dist/storage/scanner.js +188 -0
  135. package/dist/types/asset-metadata.d.ts +84 -0
  136. package/dist/types/asset-metadata.js +104 -0
  137. package/dist/types/index.d.ts +212 -0
  138. package/dist/types/index.js +1 -0
  139. package/dist/ui/animations/ErrorIndicator.d.ts +5 -0
  140. package/dist/ui/animations/ErrorIndicator.js +6 -0
  141. package/dist/ui/animations/GithubIndicator.d.ts +6 -0
  142. package/dist/ui/animations/GithubIndicator.js +9 -0
  143. package/dist/ui/animations/ProgressBar.d.ts +5 -0
  144. package/dist/ui/animations/ProgressBar.js +15 -0
  145. package/dist/ui/animations/Spinner.d.ts +5 -0
  146. package/dist/ui/animations/Spinner.js +21 -0
  147. package/dist/ui/animations/SuccessIndicator.d.ts +5 -0
  148. package/dist/ui/animations/SuccessIndicator.js +6 -0
  149. package/dist/ui/animations/SyncActivity.d.ts +5 -0
  150. package/dist/ui/animations/SyncActivity.js +21 -0
  151. package/dist/ui/animations/TransitionScreen.d.ts +7 -0
  152. package/dist/ui/animations/TransitionScreen.js +25 -0
  153. package/dist/ui/animations/useAnimationMode.d.ts +1 -0
  154. package/dist/ui/animations/useAnimationMode.js +16 -0
  155. package/dist/ui/assetDisplay.d.ts +19 -0
  156. package/dist/ui/assetDisplay.js +59 -0
  157. package/dist/ui/components/Confirm.d.ts +8 -0
  158. package/dist/ui/components/Confirm.js +14 -0
  159. package/dist/ui/components/CustomSelect.d.ts +19 -0
  160. package/dist/ui/components/CustomSelect.js +13 -0
  161. package/dist/ui/components/Header.d.ts +6 -0
  162. package/dist/ui/components/Header.js +9 -0
  163. package/dist/ui/components/HealthReport.d.ts +7 -0
  164. package/dist/ui/components/HealthReport.js +13 -0
  165. package/dist/ui/components/MarketplaceInstallConfirm.d.ts +19 -0
  166. package/dist/ui/components/MarketplaceInstallConfirm.js +23 -0
  167. package/dist/ui/components/Narrator.d.ts +9 -0
  168. package/dist/ui/components/Narrator.js +26 -0
  169. package/dist/ui/components/ScopePrompt.d.ts +8 -0
  170. package/dist/ui/components/ScopePrompt.js +23 -0
  171. package/dist/ui/components/TooSmallScreen.d.ts +8 -0
  172. package/dist/ui/components/TooSmallScreen.js +6 -0
  173. package/dist/ui/date.d.ts +2 -0
  174. package/dist/ui/date.js +33 -0
  175. package/dist/ui/layout.d.ts +23 -0
  176. package/dist/ui/layout.js +44 -0
  177. package/dist/ui/list-item.d.ts +12 -0
  178. package/dist/ui/list-item.js +1 -0
  179. package/dist/ui/marketplaceDisplay.d.ts +10 -0
  180. package/dist/ui/marketplaceDisplay.js +36 -0
  181. package/dist/ui/theme.d.ts +42 -0
  182. package/dist/ui/theme.js +47 -0
  183. package/dist/utils/asset-list-fields.d.ts +11 -0
  184. package/dist/utils/asset-list-fields.js +28 -0
  185. package/dist/utils/error-message.d.ts +2 -0
  186. package/dist/utils/error-message.js +6 -0
  187. package/dist/utils/integrity.d.ts +9 -0
  188. package/dist/utils/integrity.js +23 -0
  189. package/dist/utils/lock-migrate.d.ts +25 -0
  190. package/dist/utils/lock-migrate.js +93 -0
  191. package/dist/utils/mcp-local.d.ts +15 -0
  192. package/dist/utils/mcp-local.js +129 -0
  193. package/dist/utils/slug.d.ts +6 -0
  194. package/dist/utils/slug.js +13 -0
  195. package/dist/utils/stack-normalize.d.ts +3 -0
  196. package/dist/utils/stack-normalize.js +43 -0
  197. 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,4 @@
1
+ export declare const ConfigApp: ({ onBack }: {
2
+ onBack?: () => void;
3
+ }) => import("react/jsx-runtime").JSX.Element;
4
+ export declare function configCommand(args: string[]): Promise<void>;
@@ -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>;