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,212 @@
|
|
|
1
|
+
export type AssetType = 'skill' | 'prompt' | 'mcp';
|
|
2
|
+
export type { AssetMetadata, AssetDependency, AssetIntegrity, AssetTrustSignals, AssetVisibility, DeprecatedMetadata, CreateAssetMetadataInput, } from './asset-metadata.js';
|
|
3
|
+
export { createAssetMetadata, normalizeAssetMetadata } from './asset-metadata.js';
|
|
4
|
+
export type Scope = 'global' | 'project';
|
|
5
|
+
export type NarratorState = 'idle' | 'searching' | 'installing' | 'success' | 'error' | 'syncing' | 'updating';
|
|
6
|
+
export interface Skill {
|
|
7
|
+
name: string;
|
|
8
|
+
path: string;
|
|
9
|
+
description?: string;
|
|
10
|
+
tags?: string[];
|
|
11
|
+
category?: string;
|
|
12
|
+
installs?: number;
|
|
13
|
+
rating?: number;
|
|
14
|
+
updated?: string;
|
|
15
|
+
version?: string;
|
|
16
|
+
organization?: string;
|
|
17
|
+
hasSkillMd: boolean;
|
|
18
|
+
source?: string;
|
|
19
|
+
originalName?: string;
|
|
20
|
+
slug?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface Prompt {
|
|
24
|
+
name: string;
|
|
25
|
+
path: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
source?: string;
|
|
28
|
+
slug?: string;
|
|
29
|
+
id?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface McpConfig {
|
|
32
|
+
name: string;
|
|
33
|
+
path: string;
|
|
34
|
+
command?: string;
|
|
35
|
+
args?: string[];
|
|
36
|
+
env?: Record<string, string>;
|
|
37
|
+
source?: string;
|
|
38
|
+
slug?: string;
|
|
39
|
+
id?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Union of scan/list fields used across skills, prompts, and MCPs. */
|
|
42
|
+
export type AssetListItem = Skill | Prompt | McpConfig;
|
|
43
|
+
export interface StackMemberRef {
|
|
44
|
+
localName: string;
|
|
45
|
+
slug: string;
|
|
46
|
+
version: string;
|
|
47
|
+
}
|
|
48
|
+
export interface StackPackRef {
|
|
49
|
+
slug: string;
|
|
50
|
+
version: string;
|
|
51
|
+
}
|
|
52
|
+
/** Workspace or published stack (AMAN-STACK-SPEC-V1). */
|
|
53
|
+
export interface Stack {
|
|
54
|
+
schemaVersion?: 1;
|
|
55
|
+
recordType?: 'stack';
|
|
56
|
+
id?: string;
|
|
57
|
+
slug?: string;
|
|
58
|
+
name: string;
|
|
59
|
+
description?: string;
|
|
60
|
+
visibility?: import('./asset-metadata.js').AssetVisibility;
|
|
61
|
+
members?: {
|
|
62
|
+
skills: StackMemberRef[];
|
|
63
|
+
prompts: StackMemberRef[];
|
|
64
|
+
mcps: StackMemberRef[];
|
|
65
|
+
};
|
|
66
|
+
skills: string[];
|
|
67
|
+
prompts: string[];
|
|
68
|
+
mcps: string[];
|
|
69
|
+
packs?: StackPackRef[];
|
|
70
|
+
deprecated?: import('./asset-metadata.js').DeprecatedMetadata | null;
|
|
71
|
+
createdAt: string;
|
|
72
|
+
updatedAt: string;
|
|
73
|
+
}
|
|
74
|
+
export interface PackMemberRef {
|
|
75
|
+
slug: string;
|
|
76
|
+
version: string;
|
|
77
|
+
localName: string;
|
|
78
|
+
}
|
|
79
|
+
/** Pack manifest (AMAN-PACK-SPEC-V1). Legacy string lists remain supported. */
|
|
80
|
+
export interface Pack {
|
|
81
|
+
schemaVersion?: 1;
|
|
82
|
+
recordType?: 'pack';
|
|
83
|
+
id?: string;
|
|
84
|
+
slug?: string;
|
|
85
|
+
name: string;
|
|
86
|
+
version?: string;
|
|
87
|
+
description?: string;
|
|
88
|
+
author?: string;
|
|
89
|
+
tags?: string[];
|
|
90
|
+
visibility?: import('./asset-metadata.js').AssetVisibility;
|
|
91
|
+
integrity?: import('./asset-metadata.js').AssetIntegrity;
|
|
92
|
+
dependencies?: {
|
|
93
|
+
assets: import('./asset-metadata.js').AssetDependency[];
|
|
94
|
+
packs: Array<{
|
|
95
|
+
type: 'pack';
|
|
96
|
+
slug: string;
|
|
97
|
+
versionRange: string;
|
|
98
|
+
optional: boolean;
|
|
99
|
+
}>;
|
|
100
|
+
};
|
|
101
|
+
members?: {
|
|
102
|
+
skills: PackMemberRef[];
|
|
103
|
+
prompts: PackMemberRef[];
|
|
104
|
+
mcps: PackMemberRef[];
|
|
105
|
+
stacks: PackMemberRef[];
|
|
106
|
+
};
|
|
107
|
+
trust?: import('./asset-metadata.js').AssetTrustSignals;
|
|
108
|
+
deprecated?: import('./asset-metadata.js').DeprecatedMetadata | null;
|
|
109
|
+
skills: string[];
|
|
110
|
+
prompts: string[];
|
|
111
|
+
mcps: string[];
|
|
112
|
+
stacks: string[];
|
|
113
|
+
createdAt: string;
|
|
114
|
+
}
|
|
115
|
+
export interface Backup {
|
|
116
|
+
id: string;
|
|
117
|
+
name?: string;
|
|
118
|
+
timestamp: string;
|
|
119
|
+
skills: string[];
|
|
120
|
+
prompts: string[];
|
|
121
|
+
mcps: string[];
|
|
122
|
+
stacks: string[];
|
|
123
|
+
config: Record<string, unknown>;
|
|
124
|
+
}
|
|
125
|
+
export type LockSourceKind = 'registry' | 'github' | 'local' | 'pack' | 'import' | 'manual';
|
|
126
|
+
export interface LockSource {
|
|
127
|
+
kind: LockSourceKind;
|
|
128
|
+
ref: string;
|
|
129
|
+
}
|
|
130
|
+
export interface LockIntegrity {
|
|
131
|
+
algorithm: 'sha256';
|
|
132
|
+
checksum: string;
|
|
133
|
+
}
|
|
134
|
+
export interface LockDependency {
|
|
135
|
+
type: 'asset';
|
|
136
|
+
slug: string;
|
|
137
|
+
versionRange: string;
|
|
138
|
+
optional: boolean;
|
|
139
|
+
resolvedVersion?: string;
|
|
140
|
+
}
|
|
141
|
+
/** Single installed asset entry in aman.lock (AMAN-LOCKFILE-SPEC-V1). */
|
|
142
|
+
export interface LockEntry {
|
|
143
|
+
id: string;
|
|
144
|
+
slug: string;
|
|
145
|
+
type: AssetType;
|
|
146
|
+
localName: string;
|
|
147
|
+
version: string;
|
|
148
|
+
originalName?: string;
|
|
149
|
+
integrity: LockIntegrity;
|
|
150
|
+
source: LockSource;
|
|
151
|
+
scope: Scope;
|
|
152
|
+
installedAt: string;
|
|
153
|
+
dependencies: LockDependency[];
|
|
154
|
+
/** MCP only: true when mcp.local.json is required but missing (see AMAN-LOCKFILE-SPEC-V1 §4.1). */
|
|
155
|
+
requiresLocalConfig: boolean;
|
|
156
|
+
}
|
|
157
|
+
export interface Lockfile {
|
|
158
|
+
schemaVersion: 1;
|
|
159
|
+
generatedAt: string;
|
|
160
|
+
scope: Scope;
|
|
161
|
+
assets: LockEntry[];
|
|
162
|
+
}
|
|
163
|
+
/** User-controlled environment config — not installed asset state. */
|
|
164
|
+
export interface AmanConfig {
|
|
165
|
+
theme: 'dark' | 'light' | 'auto';
|
|
166
|
+
defaultScope: Scope;
|
|
167
|
+
environmentPath?: string;
|
|
168
|
+
storage?: {
|
|
169
|
+
type: 'local' | 'github';
|
|
170
|
+
repository?: string;
|
|
171
|
+
};
|
|
172
|
+
marketplaces: string[];
|
|
173
|
+
animationMode: 'off' | 'reduced' | 'normal';
|
|
174
|
+
github?: {
|
|
175
|
+
token?: string;
|
|
176
|
+
defaultOrg?: string;
|
|
177
|
+
};
|
|
178
|
+
experimental?: Record<string, boolean>;
|
|
179
|
+
}
|
|
180
|
+
export interface ProviderResult {
|
|
181
|
+
type: AssetType;
|
|
182
|
+
name: string;
|
|
183
|
+
source: string;
|
|
184
|
+
sources?: string[];
|
|
185
|
+
description?: string;
|
|
186
|
+
tags?: string[];
|
|
187
|
+
category?: string;
|
|
188
|
+
installs?: number;
|
|
189
|
+
rating?: number;
|
|
190
|
+
updated?: string;
|
|
191
|
+
version?: string;
|
|
192
|
+
organization?: string;
|
|
193
|
+
installed?: boolean;
|
|
194
|
+
confidence: number;
|
|
195
|
+
slug?: string;
|
|
196
|
+
/** GitHub repo stars (marketplace assets only). */
|
|
197
|
+
stars?: number;
|
|
198
|
+
/** CLI-enforced: true only for @aman/ namespace. */
|
|
199
|
+
verified?: boolean;
|
|
200
|
+
/** UI grouping: local providers vs GitHub topic marketplace. */
|
|
201
|
+
section?: 'local' | 'marketplace';
|
|
202
|
+
/** Expected content checksum from publisher metadata. */
|
|
203
|
+
checksum?: string;
|
|
204
|
+
/** github:owner/repo */
|
|
205
|
+
githubSource?: string;
|
|
206
|
+
}
|
|
207
|
+
export interface HealthCheck {
|
|
208
|
+
name: string;
|
|
209
|
+
status: 'pass' | 'fail' | 'warn';
|
|
210
|
+
message: string;
|
|
211
|
+
fix?: string;
|
|
212
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createAssetMetadata, normalizeAssetMetadata } from './asset-metadata.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const ErrorIndicator = ({ message }) => {
|
|
5
|
+
return (_jsxs(Text, { color: theme.error, children: [_jsx(Text, { bold: true, children: "\u2717" }), message ? ` ${message}` : ''] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const GithubIndicator = ({ isConnected, repository }) => {
|
|
5
|
+
if (isConnected && repository) {
|
|
6
|
+
return (_jsxs(Text, { color: theme.success, children: [_jsx(Text, { bold: true, children: "\u25C9" }), " ", repository] }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsxs(Text, { color: theme.dim, children: [_jsx(Text, { bold: true, children: "\u25CB" }), " Local Storage"] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { useResponsiveLayout } from '../layout.js';
|
|
4
|
+
import { theme } from '../theme.js';
|
|
5
|
+
export const ProgressBar = ({ progress }) => {
|
|
6
|
+
const { isCompact } = useResponsiveLayout();
|
|
7
|
+
const clampedProgress = Math.min(100, Math.max(0, progress));
|
|
8
|
+
const barWidth = isCompact ? 15 : 30;
|
|
9
|
+
const filledCount = Math.round((clampedProgress / 100) * barWidth);
|
|
10
|
+
const emptyCount = Math.max(0, barWidth - filledCount);
|
|
11
|
+
const filled = '█'.repeat(filledCount);
|
|
12
|
+
const empty = '░'.repeat(emptyCount);
|
|
13
|
+
const percentText = `${Math.round(clampedProgress)}%`.padStart(4);
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "row", alignItems: "center", children: [_jsx(Text, { color: theme.primary, children: filled }), _jsx(Text, { color: theme.borderMuted, children: empty }), _jsxs(Text, { color: theme.secondary, children: [" ", percentText] })] }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Text } from 'ink';
|
|
4
|
+
import { useAnimationMode } from './useAnimationMode.js';
|
|
5
|
+
import { theme } from '../theme.js';
|
|
6
|
+
export const Spinner = ({ label }) => {
|
|
7
|
+
const mode = useAnimationMode();
|
|
8
|
+
const [frameIndex, setFrameIndex] = useState(0);
|
|
9
|
+
const frames = ['◜', '◝', '◞', '◟'];
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (mode === 'off')
|
|
12
|
+
return;
|
|
13
|
+
const intervalTime = mode === 'reduced' ? 240 : 110;
|
|
14
|
+
const timer = setInterval(() => {
|
|
15
|
+
setFrameIndex((prev) => (prev + 1) % frames.length);
|
|
16
|
+
}, intervalTime);
|
|
17
|
+
return () => clearInterval(timer);
|
|
18
|
+
}, [mode]);
|
|
19
|
+
const frame = mode === 'off' ? frames[0] : frames[frameIndex];
|
|
20
|
+
return (_jsxs(Text, { color: theme.primary, children: [_jsx(Text, { bold: true, children: frame }), label ? ` ${label}` : ''] }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const SuccessIndicator = ({ message }) => {
|
|
5
|
+
return (_jsxs(Text, { color: theme.success, children: [_jsx(Text, { bold: true, children: "\u2713" }), message ? ` ${message}` : ''] }));
|
|
6
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Text } from 'ink';
|
|
4
|
+
import { useAnimationMode } from './useAnimationMode.js';
|
|
5
|
+
import { theme } from '../theme.js';
|
|
6
|
+
export const SyncActivity = ({ label }) => {
|
|
7
|
+
const mode = useAnimationMode();
|
|
8
|
+
const [frameIndex, setFrameIndex] = useState(0);
|
|
9
|
+
const frames = ['◉', '◐', '◑', '◒'];
|
|
10
|
+
useEffect(() => {
|
|
11
|
+
if (mode === 'off')
|
|
12
|
+
return;
|
|
13
|
+
const intervalTime = mode === 'reduced' ? 240 : 110;
|
|
14
|
+
const timer = setInterval(() => {
|
|
15
|
+
setFrameIndex((prev) => (prev + 1) % frames.length);
|
|
16
|
+
}, intervalTime);
|
|
17
|
+
return () => clearInterval(timer);
|
|
18
|
+
}, [mode]);
|
|
19
|
+
const frame = mode === 'off' ? frames[0] : frames[frameIndex];
|
|
20
|
+
return (_jsxs(Text, { color: theme.primary, children: [_jsx(Text, { bold: true, children: frame }), label ? ` ${label}` : ''] }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { Box } from 'ink';
|
|
4
|
+
import { useAnimationMode } from './useAnimationMode.js';
|
|
5
|
+
import { Spinner } from './Spinner.js';
|
|
6
|
+
import { useResponsiveLayout } from '../layout.js';
|
|
7
|
+
export const TransitionScreen = ({ message, children }) => {
|
|
8
|
+
const mode = useAnimationMode();
|
|
9
|
+
const { rows } = useResponsiveLayout();
|
|
10
|
+
const [loading, setLoading] = useState(mode !== 'off');
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (mode === 'off') {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
const duration = mode === 'reduced' ? 250 : 150;
|
|
16
|
+
const timer = setTimeout(() => {
|
|
17
|
+
setLoading(false);
|
|
18
|
+
}, duration);
|
|
19
|
+
return () => clearTimeout(timer);
|
|
20
|
+
}, [mode]);
|
|
21
|
+
if (loading) {
|
|
22
|
+
return (_jsx(Box, { flexDirection: "column", paddingX: 1, height: rows, justifyContent: "center", alignItems: "center", children: _jsx(Spinner, { label: message }) }));
|
|
23
|
+
}
|
|
24
|
+
return _jsx(_Fragment, { children: children });
|
|
25
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useAnimationMode(): 'off' | 'reduced' | 'normal';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
import { config } from '../../config/index.js';
|
|
3
|
+
export function useAnimationMode() {
|
|
4
|
+
const [mode, setMode] = useState(() => {
|
|
5
|
+
return config.get('animationMode') || 'normal';
|
|
6
|
+
});
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
const unsubscribe = config.onDidChange('animationMode', (newVal) => {
|
|
9
|
+
if (newVal) {
|
|
10
|
+
setMode(newVal);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return unsubscribe;
|
|
14
|
+
}, []);
|
|
15
|
+
return mode;
|
|
16
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AssetType, ProviderResult } from '../types/index.js';
|
|
2
|
+
export declare const ASSET_TYPE_LABELS: Record<AssetType, string>;
|
|
3
|
+
export declare const ASSET_TYPE_PLURAL: Record<AssetType, string>;
|
|
4
|
+
/** Tab/display order — MCP, Prompt, Skill (not skill-first). */
|
|
5
|
+
export declare const ASSET_TAB_ORDER: AssetType[];
|
|
6
|
+
export declare const ASSET_TYPES: AssetType[];
|
|
7
|
+
export declare function assetCompositeKey(type: AssetType, localName: string): string;
|
|
8
|
+
export declare function parseAssetCompositeKey(key: string): {
|
|
9
|
+
type: AssetType;
|
|
10
|
+
localName: string;
|
|
11
|
+
} | null;
|
|
12
|
+
export declare function assetTypeBadge(type: AssetType): string;
|
|
13
|
+
export declare function groupResultsByType<T extends {
|
|
14
|
+
type: AssetType;
|
|
15
|
+
}>(results: T[]): Record<AssetType, T[]>;
|
|
16
|
+
export declare function averageConfidence(results: {
|
|
17
|
+
confidence: number;
|
|
18
|
+
}[]): number;
|
|
19
|
+
export declare function matchesAssetSearch(item: Pick<ProviderResult, 'name' | 'description' | 'tags' | 'type'>, query: string): boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export const ASSET_TYPE_LABELS = {
|
|
2
|
+
skill: 'Skill',
|
|
3
|
+
prompt: 'Prompt',
|
|
4
|
+
mcp: 'MCP',
|
|
5
|
+
};
|
|
6
|
+
export const ASSET_TYPE_PLURAL = {
|
|
7
|
+
skill: 'Skills',
|
|
8
|
+
prompt: 'Prompts',
|
|
9
|
+
mcp: 'MCPs',
|
|
10
|
+
};
|
|
11
|
+
/** Tab/display order — MCP, Prompt, Skill (not skill-first). */
|
|
12
|
+
export const ASSET_TAB_ORDER = ['mcp', 'prompt', 'skill'];
|
|
13
|
+
export const ASSET_TYPES = [...ASSET_TAB_ORDER];
|
|
14
|
+
export function assetCompositeKey(type, localName) {
|
|
15
|
+
return `${type}:${localName}`;
|
|
16
|
+
}
|
|
17
|
+
export function parseAssetCompositeKey(key) {
|
|
18
|
+
const colon = key.indexOf(':');
|
|
19
|
+
if (colon <= 0)
|
|
20
|
+
return null;
|
|
21
|
+
const type = key.slice(0, colon);
|
|
22
|
+
if (type !== 'skill' && type !== 'prompt' && type !== 'mcp')
|
|
23
|
+
return null;
|
|
24
|
+
return { type, localName: key.slice(colon + 1) };
|
|
25
|
+
}
|
|
26
|
+
export function assetTypeBadge(type) {
|
|
27
|
+
return `[${ASSET_TYPE_LABELS[type]}]`;
|
|
28
|
+
}
|
|
29
|
+
export function groupResultsByType(results) {
|
|
30
|
+
const grouped = { skill: [], prompt: [], mcp: [] };
|
|
31
|
+
for (const item of results) {
|
|
32
|
+
grouped[item.type].push(item);
|
|
33
|
+
}
|
|
34
|
+
return grouped;
|
|
35
|
+
}
|
|
36
|
+
export function averageConfidence(results) {
|
|
37
|
+
if (results.length === 0)
|
|
38
|
+
return 0;
|
|
39
|
+
const sum = results.reduce((acc, r) => acc + r.confidence, 0);
|
|
40
|
+
return Math.round((sum / results.length) * 100);
|
|
41
|
+
}
|
|
42
|
+
export function matchesAssetSearch(item, query) {
|
|
43
|
+
const q = query.toLowerCase().trim();
|
|
44
|
+
if (!q)
|
|
45
|
+
return true;
|
|
46
|
+
if (item.name.toLowerCase().includes(q))
|
|
47
|
+
return true;
|
|
48
|
+
if (item.description?.toLowerCase().includes(q))
|
|
49
|
+
return true;
|
|
50
|
+
if (item.tags?.some((t) => t.toLowerCase().includes(q)))
|
|
51
|
+
return true;
|
|
52
|
+
if (item.type.toLowerCase().includes(q))
|
|
53
|
+
return true;
|
|
54
|
+
if (ASSET_TYPE_LABELS[item.type].toLowerCase().includes(q))
|
|
55
|
+
return true;
|
|
56
|
+
if (ASSET_TYPE_PLURAL[item.type].toLowerCase().includes(q))
|
|
57
|
+
return true;
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useInput } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const Confirm = ({ message, onConfirm, onCancel }) => {
|
|
5
|
+
useInput((input) => {
|
|
6
|
+
if (input === 'y' || input === 'Y') {
|
|
7
|
+
onConfirm();
|
|
8
|
+
}
|
|
9
|
+
else if (input === 'n' || input === 'N') {
|
|
10
|
+
onCancel();
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
return (_jsxs(Box, { children: [_jsxs(Text, { children: [message, " "] }), _jsx(Text, { color: theme.dim, children: "(y/n)" })] }));
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type ItemProps } from 'ink-select-input';
|
|
3
|
+
export declare const CustomItem: React.FC<ItemProps>;
|
|
4
|
+
export declare const CustomIndicator: React.FC<{
|
|
5
|
+
isSelected?: boolean;
|
|
6
|
+
}>;
|
|
7
|
+
interface CustomSelectInputProps<T> {
|
|
8
|
+
items: {
|
|
9
|
+
label: string;
|
|
10
|
+
value: T;
|
|
11
|
+
}[];
|
|
12
|
+
onSelect: (item: {
|
|
13
|
+
label: string;
|
|
14
|
+
value: T;
|
|
15
|
+
}) => void;
|
|
16
|
+
limit?: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function CustomSelectInput<T>({ items, onSelect, limit }: CustomSelectInputProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Text } from 'ink';
|
|
3
|
+
import SelectInput from 'ink-select-input';
|
|
4
|
+
import { theme } from '../theme.js';
|
|
5
|
+
export const CustomItem = ({ isSelected = false, label }) => {
|
|
6
|
+
return (_jsx(Text, { color: isSelected ? theme.primary : theme.text, bold: isSelected, children: label }));
|
|
7
|
+
};
|
|
8
|
+
export const CustomIndicator = ({ isSelected = false }) => {
|
|
9
|
+
return (_jsx(Text, { color: theme.primary, children: isSelected ? '› ' : ' ' }));
|
|
10
|
+
};
|
|
11
|
+
export function CustomSelectInput({ items, onSelect, limit }) {
|
|
12
|
+
return (_jsx(SelectInput, { items: items, onSelect: onSelect, itemComponent: CustomItem, indicatorComponent: CustomIndicator, limit: limit }));
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const Header = ({ compact }) => {
|
|
5
|
+
if (compact) {
|
|
6
|
+
return (_jsx(Box, { marginBottom: 1, children: _jsx(Text, { color: theme.primary, bold: true, children: "aman" }) }));
|
|
7
|
+
}
|
|
8
|
+
return (_jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [_jsx(Text, { color: theme.primary, bold: true, children: "aman" }), _jsx(Text, { color: theme.dim, children: "AI environment manager" })] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { theme } from '../theme.js';
|
|
4
|
+
export const HealthReport = ({ checks }) => {
|
|
5
|
+
const passed = checks.filter((c) => c.status === 'pass').length;
|
|
6
|
+
const failed = checks.filter((c) => c.status === 'fail').length;
|
|
7
|
+
const warned = checks.filter((c) => c.status === 'warn').length;
|
|
8
|
+
return (_jsxs(Box, { flexDirection: "column", children: [checks.map((check, i) => {
|
|
9
|
+
const icon = check.status === 'pass' ? '✓' : check.status === 'fail' ? '✗' : '!';
|
|
10
|
+
const iconColor = check.status === 'pass' ? theme.success : check.status === 'fail' ? theme.error : theme.warning;
|
|
11
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Box, { children: [_jsxs(Text, { color: iconColor, bold: true, children: [icon, " "] }), _jsx(Box, { width: 20, children: _jsx(Text, { bold: true, children: check.name }) }), _jsx(Text, { color: theme.dim, children: check.message })] }), check.fix && (_jsxs(Text, { color: theme.dim, children: [" Fix: ", check.fix] }))] }, i));
|
|
12
|
+
}), _jsx(Box, { marginTop: 1, children: _jsxs(Text, { color: theme.dim, children: [passed, " passed", failed > 0 ? `, ${failed} failed` : '', warned > 0 ? `, ${warned} warnings` : ''] }) })] }));
|
|
13
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AssetType, Scope } from '../../types/index.js';
|
|
3
|
+
export interface MarketplaceInstallDetails {
|
|
4
|
+
name: string;
|
|
5
|
+
type: AssetType;
|
|
6
|
+
slug?: string;
|
|
7
|
+
author?: string;
|
|
8
|
+
version?: string;
|
|
9
|
+
source: string;
|
|
10
|
+
checksum?: string;
|
|
11
|
+
verified?: boolean;
|
|
12
|
+
}
|
|
13
|
+
interface MarketplaceInstallConfirmProps {
|
|
14
|
+
details: MarketplaceInstallDetails;
|
|
15
|
+
onConfirm: (scope: Scope) => void;
|
|
16
|
+
onCancel: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const MarketplaceInstallConfirm: React.FC<MarketplaceInstallConfirmProps>;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { Box, Text } from 'ink';
|
|
4
|
+
import { CustomSelectInput } from './CustomSelect.js';
|
|
5
|
+
import { ScopePrompt } from './ScopePrompt.js';
|
|
6
|
+
import { theme } from '../theme.js';
|
|
7
|
+
import { ASSET_TYPE_PLURAL } from '../assetDisplay.js';
|
|
8
|
+
import { titleize } from '../marketplaceDisplay.js';
|
|
9
|
+
export const MarketplaceInstallConfirm = ({ details, onConfirm, onCancel, }) => {
|
|
10
|
+
const [phase, setPhase] = React.useState('review');
|
|
11
|
+
if (phase === 'scope') {
|
|
12
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { bold: true, children: ["Install ", titleize(details.name), "?"] }), _jsx(Box, { marginTop: 1, children: _jsx(ScopePrompt, { onSelect: (s) => onConfirm(s) }) }), _jsx(Box, { marginTop: 1, children: _jsx(Text, { color: theme.dim, children: "Select scope \u00B7 esc cancel" }) })] }));
|
|
13
|
+
}
|
|
14
|
+
return (_jsxs(Box, { flexDirection: "column", children: [_jsxs(Text, { bold: true, children: ["Install ", titleize(details.name), "?"] }), _jsx(Text, { children: ' ' }), _jsxs(Text, { children: ["Type: ", _jsx(Text, { color: theme.text, children: ASSET_TYPE_PLURAL[details.type].slice(0, -1) })] }), details.author && (_jsxs(Text, { children: ["Author: ", _jsx(Text, { color: theme.text, children: details.author }), details.verified ? _jsx(Text, { color: theme.success, children: " \u2713 Aman" }) : null] })), details.version && (_jsxs(Text, { children: ["Version: ", _jsx(Text, { color: theme.text, children: details.version })] })), _jsxs(Text, { children: ["Source: ", _jsx(Text, { color: theme.text, children: details.source })] }), details.checksum && (_jsxs(Text, { children: ["Checksum: ", _jsx(Text, { color: theme.dim, children: details.checksum })] })), _jsx(Box, { marginTop: 1, children: _jsx(CustomSelectInput, { items: [
|
|
15
|
+
{ label: '❯ Install', value: 'install' },
|
|
16
|
+
{ label: ' Cancel', value: 'cancel' },
|
|
17
|
+
], onSelect: (item) => {
|
|
18
|
+
if (item.value === 'cancel')
|
|
19
|
+
onCancel();
|
|
20
|
+
else
|
|
21
|
+
setPhase('scope');
|
|
22
|
+
} }) })] }));
|
|
23
|
+
};
|