@detergent-software/atk 0.12.1-dev.2
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/build/cli.d.ts +3 -0
- package/build/cli.d.ts.map +1 -0
- package/build/cli.js +35 -0
- package/build/cli.js.map +1 -0
- package/build/commands/_app.d.ts +3 -0
- package/build/commands/_app.d.ts.map +1 -0
- package/build/commands/_app.js +12 -0
- package/build/commands/_app.js.map +1 -0
- package/build/commands/audit.d.ts +12 -0
- package/build/commands/audit.d.ts.map +1 -0
- package/build/commands/audit.js +78 -0
- package/build/commands/audit.js.map +1 -0
- package/build/commands/browse.d.ts +15 -0
- package/build/commands/browse.d.ts.map +1 -0
- package/build/commands/browse.js +284 -0
- package/build/commands/browse.js.map +1 -0
- package/build/commands/cache.d.ts +13 -0
- package/build/commands/cache.d.ts.map +1 -0
- package/build/commands/cache.js +67 -0
- package/build/commands/cache.js.map +1 -0
- package/build/commands/config.d.ts +13 -0
- package/build/commands/config.d.ts.map +1 -0
- package/build/commands/config.js +62 -0
- package/build/commands/config.js.map +1 -0
- package/build/commands/diff.d.ts +16 -0
- package/build/commands/diff.d.ts.map +1 -0
- package/build/commands/diff.js +158 -0
- package/build/commands/diff.js.map +1 -0
- package/build/commands/doctor.d.ts +11 -0
- package/build/commands/doctor.d.ts.map +1 -0
- package/build/commands/doctor.js +30 -0
- package/build/commands/doctor.js.map +1 -0
- package/build/commands/index.d.ts +3 -0
- package/build/commands/index.d.ts.map +1 -0
- package/build/commands/index.js +30 -0
- package/build/commands/index.js.map +1 -0
- package/build/commands/info.d.ts +25 -0
- package/build/commands/info.d.ts.map +1 -0
- package/build/commands/info.js +198 -0
- package/build/commands/info.js.map +1 -0
- package/build/commands/init.d.ts +17 -0
- package/build/commands/init.d.ts.map +1 -0
- package/build/commands/init.js +504 -0
- package/build/commands/init.js.map +1 -0
- package/build/commands/install.d.ts +18 -0
- package/build/commands/install.d.ts.map +1 -0
- package/build/commands/install.js +186 -0
- package/build/commands/install.js.map +1 -0
- package/build/commands/list.d.ts +20 -0
- package/build/commands/list.d.ts.map +1 -0
- package/build/commands/list.js +61 -0
- package/build/commands/list.js.map +1 -0
- package/build/commands/outdated.d.ts +21 -0
- package/build/commands/outdated.d.ts.map +1 -0
- package/build/commands/outdated.js +81 -0
- package/build/commands/outdated.js.map +1 -0
- package/build/commands/pin.d.ts +22 -0
- package/build/commands/pin.d.ts.map +1 -0
- package/build/commands/pin.js +94 -0
- package/build/commands/pin.js.map +1 -0
- package/build/commands/prune.d.ts +14 -0
- package/build/commands/prune.d.ts.map +1 -0
- package/build/commands/prune.js +203 -0
- package/build/commands/prune.js.map +1 -0
- package/build/commands/publish.d.ts +14 -0
- package/build/commands/publish.d.ts.map +1 -0
- package/build/commands/publish.js +345 -0
- package/build/commands/publish.js.map +1 -0
- package/build/commands/search.d.ts +16 -0
- package/build/commands/search.d.ts.map +1 -0
- package/build/commands/search.js +80 -0
- package/build/commands/search.js.map +1 -0
- package/build/commands/sync.d.ts +15 -0
- package/build/commands/sync.d.ts.map +1 -0
- package/build/commands/sync.js +209 -0
- package/build/commands/sync.js.map +1 -0
- package/build/commands/uninstall.d.ts +18 -0
- package/build/commands/uninstall.d.ts.map +1 -0
- package/build/commands/uninstall.js +304 -0
- package/build/commands/uninstall.js.map +1 -0
- package/build/commands/unpin.d.ts +22 -0
- package/build/commands/unpin.d.ts.map +1 -0
- package/build/commands/unpin.js +79 -0
- package/build/commands/unpin.js.map +1 -0
- package/build/commands/update.d.ts +17 -0
- package/build/commands/update.d.ts.map +1 -0
- package/build/commands/update.js +151 -0
- package/build/commands/update.js.map +1 -0
- package/build/commands/why.d.ts +23 -0
- package/build/commands/why.d.ts.map +1 -0
- package/build/commands/why.js +108 -0
- package/build/commands/why.js.map +1 -0
- package/build/components/AssetDetail.d.ts +32 -0
- package/build/components/AssetDetail.d.ts.map +1 -0
- package/build/components/AssetDetail.js +45 -0
- package/build/components/AssetDetail.js.map +1 -0
- package/build/components/AssetTable.d.ts +25 -0
- package/build/components/AssetTable.d.ts.map +1 -0
- package/build/components/AssetTable.js +96 -0
- package/build/components/AssetTable.js.map +1 -0
- package/build/components/BrowseExpandedBundle.d.ts +26 -0
- package/build/components/BrowseExpandedBundle.d.ts.map +1 -0
- package/build/components/BrowseExpandedBundle.js +59 -0
- package/build/components/BrowseExpandedBundle.js.map +1 -0
- package/build/components/BrowseExpandedRow.d.ts +14 -0
- package/build/components/BrowseExpandedRow.d.ts.map +1 -0
- package/build/components/BrowseExpandedRow.js +9 -0
- package/build/components/BrowseExpandedRow.js.map +1 -0
- package/build/components/BrowseList.d.ts +26 -0
- package/build/components/BrowseList.d.ts.map +1 -0
- package/build/components/BrowseList.js +101 -0
- package/build/components/BrowseList.js.map +1 -0
- package/build/components/BundleDetail.d.ts +7 -0
- package/build/components/BundleDetail.d.ts.map +1 -0
- package/build/components/BundleDetail.js +12 -0
- package/build/components/BundleDetail.js.map +1 -0
- package/build/components/DependencyTree.d.ts +19 -0
- package/build/components/DependencyTree.d.ts.map +1 -0
- package/build/components/DependencyTree.js +21 -0
- package/build/components/DependencyTree.js.map +1 -0
- package/build/components/DiagnosticList.d.ts +19 -0
- package/build/components/DiagnosticList.d.ts.map +1 -0
- package/build/components/DiagnosticList.js +17 -0
- package/build/components/DiagnosticList.js.map +1 -0
- package/build/components/DiffView.d.ts +30 -0
- package/build/components/DiffView.d.ts.map +1 -0
- package/build/components/DiffView.js +32 -0
- package/build/components/DiffView.js.map +1 -0
- package/build/components/DryRunBanner.d.ts +11 -0
- package/build/components/DryRunBanner.d.ts.map +1 -0
- package/build/components/DryRunBanner.js +6 -0
- package/build/components/DryRunBanner.js.map +1 -0
- package/build/components/Field.d.ts +12 -0
- package/build/components/Field.d.ts.map +1 -0
- package/build/components/Field.js +9 -0
- package/build/components/Field.js.map +1 -0
- package/build/components/FilterBar.d.ts +18 -0
- package/build/components/FilterBar.d.ts.map +1 -0
- package/build/components/FilterBar.js +21 -0
- package/build/components/FilterBar.js.map +1 -0
- package/build/components/Header.d.ts +13 -0
- package/build/components/Header.d.ts.map +1 -0
- package/build/components/Header.js +20 -0
- package/build/components/Header.js.map +1 -0
- package/build/components/HelpBar.d.ts +11 -0
- package/build/components/HelpBar.d.ts.map +1 -0
- package/build/components/HelpBar.js +9 -0
- package/build/components/HelpBar.js.map +1 -0
- package/build/components/InstallConfirmBar.d.ts +9 -0
- package/build/components/InstallConfirmBar.d.ts.map +1 -0
- package/build/components/InstallConfirmBar.js +23 -0
- package/build/components/InstallConfirmBar.js.map +1 -0
- package/build/components/InstallSummary.d.ts +29 -0
- package/build/components/InstallSummary.d.ts.map +1 -0
- package/build/components/InstallSummary.js +12 -0
- package/build/components/InstallSummary.js.map +1 -0
- package/build/components/SectionDivider.d.ts +5 -0
- package/build/components/SectionDivider.d.ts.map +1 -0
- package/build/components/SectionDivider.js +11 -0
- package/build/components/SectionDivider.js.map +1 -0
- package/build/components/Spinner.d.ts +13 -0
- package/build/components/Spinner.d.ts.map +1 -0
- package/build/components/Spinner.js +11 -0
- package/build/components/Spinner.js.map +1 -0
- package/build/components/StatusBadge.d.ts +23 -0
- package/build/components/StatusBadge.d.ts.map +1 -0
- package/build/components/StatusBadge.js +43 -0
- package/build/components/StatusBadge.js.map +1 -0
- package/build/components/index.d.ts +20 -0
- package/build/components/index.d.ts.map +1 -0
- package/build/components/index.js +20 -0
- package/build/components/index.js.map +1 -0
- package/build/hooks/useBrowseState.d.ts +122 -0
- package/build/hooks/useBrowseState.d.ts.map +1 -0
- package/build/hooks/useBrowseState.js +315 -0
- package/build/hooks/useBrowseState.js.map +1 -0
- package/build/hooks/useCommand.d.ts +23 -0
- package/build/hooks/useCommand.d.ts.map +1 -0
- package/build/hooks/useCommand.js +43 -0
- package/build/hooks/useCommand.js.map +1 -0
- package/build/lib/adapter.d.ts +40 -0
- package/build/lib/adapter.d.ts.map +1 -0
- package/build/lib/adapter.js +112 -0
- package/build/lib/adapter.js.map +1 -0
- package/build/lib/auth.d.ts +31 -0
- package/build/lib/auth.d.ts.map +1 -0
- package/build/lib/auth.js +101 -0
- package/build/lib/auth.js.map +1 -0
- package/build/lib/breakpoints.d.ts +3 -0
- package/build/lib/breakpoints.d.ts.map +1 -0
- package/build/lib/breakpoints.js +8 -0
- package/build/lib/breakpoints.js.map +1 -0
- package/build/lib/checksum.d.ts +31 -0
- package/build/lib/checksum.d.ts.map +1 -0
- package/build/lib/checksum.js +78 -0
- package/build/lib/checksum.js.map +1 -0
- package/build/lib/config.d.ts +42 -0
- package/build/lib/config.d.ts.map +1 -0
- package/build/lib/config.js +123 -0
- package/build/lib/config.js.map +1 -0
- package/build/lib/detector.d.ts +35 -0
- package/build/lib/detector.d.ts.map +1 -0
- package/build/lib/detector.js +125 -0
- package/build/lib/detector.js.map +1 -0
- package/build/lib/diagnostics.d.ts +10 -0
- package/build/lib/diagnostics.d.ts.map +1 -0
- package/build/lib/diagnostics.js +195 -0
- package/build/lib/diagnostics.js.map +1 -0
- package/build/lib/diff.d.ts +34 -0
- package/build/lib/diff.d.ts.map +1 -0
- package/build/lib/diff.js +78 -0
- package/build/lib/diff.js.map +1 -0
- package/build/lib/fetch-retry.d.ts +43 -0
- package/build/lib/fetch-retry.d.ts.map +1 -0
- package/build/lib/fetch-retry.js +137 -0
- package/build/lib/fetch-retry.js.map +1 -0
- package/build/lib/github.d.ts +57 -0
- package/build/lib/github.d.ts.map +1 -0
- package/build/lib/github.js +96 -0
- package/build/lib/github.js.map +1 -0
- package/build/lib/gitignore.d.ts +37 -0
- package/build/lib/gitignore.d.ts.map +1 -0
- package/build/lib/gitignore.js +142 -0
- package/build/lib/gitignore.js.map +1 -0
- package/build/lib/init.d.ts +100 -0
- package/build/lib/init.d.ts.map +1 -0
- package/build/lib/init.js +295 -0
- package/build/lib/init.js.map +1 -0
- package/build/lib/installer.d.ts +50 -0
- package/build/lib/installer.d.ts.map +1 -0
- package/build/lib/installer.js +435 -0
- package/build/lib/installer.js.map +1 -0
- package/build/lib/lockfile.d.ts +170 -0
- package/build/lib/lockfile.d.ts.map +1 -0
- package/build/lib/lockfile.js +437 -0
- package/build/lib/lockfile.js.map +1 -0
- package/build/lib/markdown.d.ts +9 -0
- package/build/lib/markdown.d.ts.map +1 -0
- package/build/lib/markdown.js +67 -0
- package/build/lib/markdown.js.map +1 -0
- package/build/lib/parse-json.d.ts +34 -0
- package/build/lib/parse-json.d.ts.map +1 -0
- package/build/lib/parse-json.js +52 -0
- package/build/lib/parse-json.js.map +1 -0
- package/build/lib/paths.d.ts +28 -0
- package/build/lib/paths.d.ts.map +1 -0
- package/build/lib/paths.js +68 -0
- package/build/lib/paths.js.map +1 -0
- package/build/lib/publisher.d.ts +49 -0
- package/build/lib/publisher.d.ts.map +1 -0
- package/build/lib/publisher.js +388 -0
- package/build/lib/publisher.js.map +1 -0
- package/build/lib/registry.d.ts +97 -0
- package/build/lib/registry.d.ts.map +1 -0
- package/build/lib/registry.js +248 -0
- package/build/lib/registry.js.map +1 -0
- package/build/lib/resolver.d.ts +50 -0
- package/build/lib/resolver.d.ts.map +1 -0
- package/build/lib/resolver.js +110 -0
- package/build/lib/resolver.js.map +1 -0
- package/build/lib/schemas/adapter.d.ts +33 -0
- package/build/lib/schemas/adapter.d.ts.map +1 -0
- package/build/lib/schemas/adapter.js +27 -0
- package/build/lib/schemas/adapter.js.map +1 -0
- package/build/lib/schemas/bundle.d.ts +38 -0
- package/build/lib/schemas/bundle.d.ts.map +1 -0
- package/build/lib/schemas/bundle.js +19 -0
- package/build/lib/schemas/bundle.js.map +1 -0
- package/build/lib/schemas/config.d.ts +12 -0
- package/build/lib/schemas/config.d.ts.map +1 -0
- package/build/lib/schemas/config.js +14 -0
- package/build/lib/schemas/config.js.map +1 -0
- package/build/lib/schemas/index.d.ts +7 -0
- package/build/lib/schemas/index.d.ts.map +1 -0
- package/build/lib/schemas/index.js +7 -0
- package/build/lib/schemas/index.js.map +1 -0
- package/build/lib/schemas/lockfile.d.ts +102 -0
- package/build/lib/schemas/lockfile.d.ts.map +1 -0
- package/build/lib/schemas/lockfile.js +50 -0
- package/build/lib/schemas/lockfile.js.map +1 -0
- package/build/lib/schemas/manifest.d.ts +91 -0
- package/build/lib/schemas/manifest.d.ts.map +1 -0
- package/build/lib/schemas/manifest.js +42 -0
- package/build/lib/schemas/manifest.js.map +1 -0
- package/build/lib/schemas/registry.d.ts +225 -0
- package/build/lib/schemas/registry.d.ts.map +1 -0
- package/build/lib/schemas/registry.js +59 -0
- package/build/lib/schemas/registry.js.map +1 -0
- package/build/lib/search.d.ts +23 -0
- package/build/lib/search.d.ts.map +1 -0
- package/build/lib/search.js +139 -0
- package/build/lib/search.js.map +1 -0
- package/build/lib/tool-resolver.d.ts +12 -0
- package/build/lib/tool-resolver.d.ts.map +1 -0
- package/build/lib/tool-resolver.js +24 -0
- package/build/lib/tool-resolver.js.map +1 -0
- package/build/lib/uninstaller.d.ts +109 -0
- package/build/lib/uninstaller.d.ts.map +1 -0
- package/build/lib/uninstaller.js +368 -0
- package/build/lib/uninstaller.js.map +1 -0
- package/build/lib/updater.d.ts +68 -0
- package/build/lib/updater.d.ts.map +1 -0
- package/build/lib/updater.js +230 -0
- package/build/lib/updater.js.map +1 -0
- package/build/lib/version.d.ts +13 -0
- package/build/lib/version.d.ts.map +1 -0
- package/build/lib/version.js +30 -0
- package/build/lib/version.js.map +1 -0
- package/build/windows-esm-loader.d.ts +15 -0
- package/build/windows-esm-loader.d.ts.map +1 -0
- package/build/windows-esm-loader.js +11 -0
- package/build/windows-esm-loader.js.map +1 -0
- package/package.json +67 -0
- package/tool-adapters/claude-code.json +34 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export default function BrowseExpandedBundle({ bundle, bundleDeps, terminalWidth }) {
|
|
4
|
+
const assets = bundle.assets ?? [];
|
|
5
|
+
const { depMap, totalDepCount } = bundleDeps;
|
|
6
|
+
const separatorWidth = Math.max(20, terminalWidth - 10);
|
|
7
|
+
const headerLabel = totalDepCount > 0
|
|
8
|
+
? `Assets (${assets.length} direct + ${totalDepCount} dependencies):`
|
|
9
|
+
: `Assets (${assets.length}):`;
|
|
10
|
+
return (_jsxs(Box, { flexDirection: 'column', paddingLeft: 4, children: [_jsx(Text, { dimColor: true, children: '─'.repeat(separatorWidth) }), _jsx(Text, { wrap: 'truncate', children: bundle.description }), _jsxs(Box, { gap: 2, children: [bundle.tags.length > 0 && (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Tags: " }), _jsx(Text, { color: 'blue', children: bundle.tags.join(', ') })] })), _jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Author: " }), _jsx(Text, { children: bundle.author })] })] }), assets.length > 0 && (_jsxs(Box, { flexDirection: 'column', children: [_jsx(Text, { dimColor: true, children: headerLabel }), assets.map((a) => {
|
|
11
|
+
const key = `${a.type}/${a.name}`;
|
|
12
|
+
const deps = depMap.get(key);
|
|
13
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [' ', _jsxs(Text, { dimColor: true, children: [a.type, "/"] }), _jsx(Text, { children: a.name })] }), deps?.map((d) => (_jsxs(Text, { children: [' ', _jsxs(Text, { dimColor: true, children: ["\u2514 ", d.type, "/"] }), _jsx(Text, { dimColor: true, children: d.name })] }, `${d.type}/${d.name}`)))] }, key));
|
|
14
|
+
})] })), _jsx(Text, { dimColor: true, children: '─'.repeat(separatorWidth) })] }));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Resolve transitive dependencies for each bundle asset.
|
|
18
|
+
* Returns a map of "type/name" → array of dependency RegistryAssets,
|
|
19
|
+
* and the total count of unique transitive dependencies.
|
|
20
|
+
*/
|
|
21
|
+
export function resolveBundleDependencies(registryAssets, bundleAssetRefs) {
|
|
22
|
+
const assetIndex = new Map();
|
|
23
|
+
for (const a of registryAssets) {
|
|
24
|
+
assetIndex.set(`${a.type}/${a.name}`, a);
|
|
25
|
+
}
|
|
26
|
+
const bundleKeys = new Set(bundleAssetRefs.map((r) => `${r.type}/${r.name}`));
|
|
27
|
+
const depMap = new Map();
|
|
28
|
+
const allDeps = new Set();
|
|
29
|
+
for (const ref of bundleAssetRefs) {
|
|
30
|
+
const key = `${ref.type}/${ref.name}`;
|
|
31
|
+
const asset = assetIndex.get(key);
|
|
32
|
+
if (!asset)
|
|
33
|
+
continue;
|
|
34
|
+
const deps = [];
|
|
35
|
+
const visited = new Set();
|
|
36
|
+
const latestVersion = asset.versions[asset.latest];
|
|
37
|
+
const stack = [...(latestVersion?.dependencies ?? [])];
|
|
38
|
+
while (stack.length > 0) {
|
|
39
|
+
const dep = stack.pop();
|
|
40
|
+
const depKey = `${dep.type}/${dep.name}`;
|
|
41
|
+
if (visited.has(depKey) || bundleKeys.has(depKey))
|
|
42
|
+
continue;
|
|
43
|
+
visited.add(depKey);
|
|
44
|
+
const depAsset = assetIndex.get(depKey);
|
|
45
|
+
if (!depAsset)
|
|
46
|
+
continue;
|
|
47
|
+
deps.push(depAsset);
|
|
48
|
+
allDeps.add(depKey);
|
|
49
|
+
const depLatest = depAsset.versions[depAsset.latest];
|
|
50
|
+
stack.push(...(depLatest?.dependencies ?? []));
|
|
51
|
+
}
|
|
52
|
+
if (deps.length > 0) {
|
|
53
|
+
deps.sort((a, b) => `${a.type}/${a.name}`.localeCompare(`${b.type}/${b.name}`));
|
|
54
|
+
depMap.set(key, deps);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return { depMap, totalDepCount: allDeps.size };
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=BrowseExpandedBundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseExpandedBundle.js","sourceRoot":"","sources":["../../src/components/BrowseExpandedBundle.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAmBhC,MAAM,CAAC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CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;YACrD,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,SAAS,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,CAAC;QACjD,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACpB,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;YAChF,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACxB,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { RegistryAsset } from '../lib/schemas/registry.js';
|
|
2
|
+
interface BrowseExpandedRowProps {
|
|
3
|
+
/** The asset to show details for */
|
|
4
|
+
asset: RegistryAsset;
|
|
5
|
+
/** Currently installed version, if any */
|
|
6
|
+
installedVersion?: string;
|
|
7
|
+
/** Whether this asset is already installed */
|
|
8
|
+
isInstalled: boolean;
|
|
9
|
+
/** Terminal width for responsive layout */
|
|
10
|
+
terminalWidth: number;
|
|
11
|
+
}
|
|
12
|
+
export default function BrowseExpandedRow({ asset, installedVersion, isInstalled, terminalWidth, }: BrowseExpandedRowProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
14
|
+
//# sourceMappingURL=BrowseExpandedRow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseExpandedRow.d.ts","sourceRoot":"","sources":["../../src/components/BrowseExpandedRow.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAIhE,UAAU,sBAAsB;IAC9B,oCAAoC;IACpC,KAAK,EAAE,aAAa,CAAC;IACrB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,8CAA8C;IAC9C,WAAW,EAAE,OAAO,CAAC;IACrB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,GACd,EAAE,sBAAsB,2CA2CxB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import StatusBadge from './StatusBadge.js';
|
|
4
|
+
export default function BrowseExpandedRow({ asset, installedVersion, isInstalled, terminalWidth, }) {
|
|
5
|
+
const latestVersion = asset.versions[asset.latest];
|
|
6
|
+
const separatorWidth = Math.max(20, terminalWidth - 10);
|
|
7
|
+
return (_jsxs(Box, { flexDirection: 'column', paddingLeft: 4, children: [_jsx(Text, { dimColor: true, children: '─'.repeat(separatorWidth) }), _jsx(Text, { wrap: 'truncate', children: latestVersion?.description ?? '' }), _jsxs(Box, { gap: 2, children: [asset.tags.length > 0 && (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Tags: " }), _jsx(Text, { color: 'blue', children: asset.tags.join(', ') })] })), (latestVersion?.tools ?? []).length > 0 && (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Tools: " }), _jsx(Text, { children: (latestVersion?.tools ?? []).join(', ') })] }))] }), _jsxs(Box, { gap: 2, children: [(latestVersion?.dependencies ?? []).length > 0 && (_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Deps: " }), _jsx(Text, { children: (latestVersion?.dependencies ?? []).map((d) => d.name).join(', ') })] })), _jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Trust: " }), _jsx(StatusBadge, { level: latestVersion?.trustLevel ?? 'experimental' })] }), isInstalled && (_jsxs(Text, { children: [_jsx(Text, { color: 'green', children: "\u2713 installed" }), installedVersion && _jsxs(Text, { dimColor: true, children: [" v", installedVersion] })] }))] }), _jsx(Text, { dimColor: true, children: '─'.repeat(separatorWidth) })] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=BrowseExpandedRow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseExpandedRow.js","sourceRoot":"","sources":["../../src/components/BrowseExpandedRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAIhC,OAAO,WAAW,MAAM,kBAAkB,CAAC;AAa3C,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAAC,EACxC,KAAK,EACL,gBAAgB,EAChB,WAAW,EACX,aAAa,GACU;IACvB,MAAM,aAAa,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;IACnD,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,aAAa,GAAG,EAAE,CAAC,CAAC;IAExD,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,WAAW,EAAE,CAAC,aACxC,KAAC,IAAI,IAAC,QAAQ,kBAAE,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,GAAQ,EAClD,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,YAAE,aAAa,EAAE,WAAW,IAAI,EAAE,GAAQ,EAC/D,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACR,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,CACxB,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,QAAQ,6BAAc,EAC5B,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAQ,IAC5C,CACR,EACA,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CAC1C,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,QAAQ,8BAAe,EAC7B,KAAC,IAAI,cAAE,CAAC,aAAa,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAQ,IACjD,CACR,IACG,EACN,MAAC,GAAG,IAAC,GAAG,EAAE,CAAC,aACR,CAAC,aAAa,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,MAAM,GAAG,CAAC,IAAI,CACjD,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,QAAQ,6BAAc,EAC5B,KAAC,IAAI,cAAE,CAAC,aAAa,EAAE,YAAY,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,GAAQ,IAC3E,CACR,EACD,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,QAAQ,8BAAe,EAC7B,KAAC,WAAW,IAAC,KAAK,EAAE,aAAa,EAAE,UAAU,IAAI,cAAc,GAAI,IAC9D,EACN,WAAW,IAAI,CACd,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,iCAAmB,EACrC,gBAAgB,IAAI,MAAC,IAAI,IAAC,QAAQ,yBAAI,gBAAgB,IAAQ,IAC1D,CACR,IACG,EACN,KAAC,IAAI,IAAC,QAAQ,kBAAE,GAAG,CAAC,MAAM,CAAC,cAAc,CAAC,GAAQ,IAC9C,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AssetTypeFilter, BrowseItem } from '../hooks/useBrowseState.js';
|
|
2
|
+
import type { Lockfile } from '../lib/schemas/lockfile.js';
|
|
3
|
+
import type { RegistryAsset } from '../lib/schemas/registry.js';
|
|
4
|
+
interface BrowseListProps {
|
|
5
|
+
/** Index of the cursor in the items array */
|
|
6
|
+
cursorIndex: number;
|
|
7
|
+
/** Index of expanded item, or null */
|
|
8
|
+
expandedIndex: null | number;
|
|
9
|
+
/** Filtered items to display */
|
|
10
|
+
items: BrowseItem[];
|
|
11
|
+
/** Current lockfile for installed badges */
|
|
12
|
+
lockfile: Lockfile;
|
|
13
|
+
/** All registry assets for resolving transitive dependencies */
|
|
14
|
+
registryAssets: RegistryAsset[];
|
|
15
|
+
/** First visible item index */
|
|
16
|
+
scrollOffset: number;
|
|
17
|
+
/** Terminal width for responsive layout */
|
|
18
|
+
terminalWidth: number;
|
|
19
|
+
/** Active type filter tab */
|
|
20
|
+
typeFilter: AssetTypeFilter;
|
|
21
|
+
/** Available height in rows for the list area */
|
|
22
|
+
viewportHeight: number;
|
|
23
|
+
}
|
|
24
|
+
export default function BrowseList({ cursorIndex, expandedIndex, items, lockfile, registryAssets, scrollOffset, terminalWidth, typeFilter, viewportHeight, }: BrowseListProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=BrowseList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseList.d.ts","sourceRoot":"","sources":["../../src/components/BrowseList.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC9E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAoBhE,UAAU,eAAe;IACvB,6CAA6C;IAC7C,WAAW,EAAE,MAAM,CAAC;IACpB,sCAAsC;IACtC,aAAa,EAAE,IAAI,GAAG,MAAM,CAAC;IAC7B,gCAAgC;IAChC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,QAAQ,CAAC;IACnB,gEAAgE;IAChE,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,+BAA+B;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,6BAA6B;IAC7B,UAAU,EAAE,eAAe,CAAC;IAC5B,iDAAiD;IACjD,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,WAAW,EACX,aAAa,EACb,KAAK,EACL,QAAQ,EACR,cAAc,EACd,YAAY,EACZ,aAAa,EACb,UAAU,EACV,cAAc,GACf,EAAE,eAAe,2CA0PjB"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { getBreakpoint } from '../lib/breakpoints.js';
|
|
4
|
+
import { findInstalledAsset, isInstalled as isAssetInstalled } from '../lib/lockfile.js';
|
|
5
|
+
import BrowseExpandedBundle, { resolveBundleDependencies } from './BrowseExpandedBundle.js';
|
|
6
|
+
import BrowseExpandedRow from './BrowseExpandedRow.js';
|
|
7
|
+
import StatusBadge from './StatusBadge.js';
|
|
8
|
+
const COLUMN_WIDTHS = {
|
|
9
|
+
medium: { cursor: 3, name: 24, status: 12, type: 14, version: 10 },
|
|
10
|
+
narrow: { cursor: 3, name: 20, status: 12, version: 10 },
|
|
11
|
+
wide: { cursor: 3, name: 28, status: 12, trust: 14, type: 18, version: 10 },
|
|
12
|
+
};
|
|
13
|
+
const BUNDLE_COLUMN_WIDTHS = {
|
|
14
|
+
medium: { assets: 18, cursor: 3, name: 24, status: 12, version: 10 },
|
|
15
|
+
narrow: { assets: 14, cursor: 3, name: 20, status: 12, version: 10 },
|
|
16
|
+
wide: { assets: 18, cursor: 3, name: 28, status: 12, version: 10 },
|
|
17
|
+
};
|
|
18
|
+
export default function BrowseList({ cursorIndex, expandedIndex, items, lockfile, registryAssets, scrollOffset, terminalWidth, typeFilter, viewportHeight, }) {
|
|
19
|
+
if (items.length === 0) {
|
|
20
|
+
const label = typeFilter === 'bundle' ? 'bundles' : 'assets';
|
|
21
|
+
return (_jsx(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: _jsx(Box, { paddingY: 1, children: _jsxs(Text, { dimColor: true, children: ["No ", label, " match your filters."] }) }) }));
|
|
22
|
+
}
|
|
23
|
+
const isBundleTab = typeFilter === 'bundle';
|
|
24
|
+
const bp = getBreakpoint(terminalWidth);
|
|
25
|
+
const showType = bp !== 'narrow';
|
|
26
|
+
const showTrust = bp === 'wide';
|
|
27
|
+
const cols = COLUMN_WIDTHS[bp];
|
|
28
|
+
const bundleCols = BUNDLE_COLUMN_WIDTHS[bp];
|
|
29
|
+
const aboveCount = scrollOffset;
|
|
30
|
+
// Resolve deps for the expanded bundle (if any) once, used for both line-height calculation and rendering
|
|
31
|
+
const expandedItem = expandedIndex !== null ? items[expandedIndex] : null;
|
|
32
|
+
const expandedBundle = expandedItem?.kind === 'bundle' ? expandedItem.data : null;
|
|
33
|
+
const expandedBundleDeps = expandedBundle
|
|
34
|
+
? resolveBundleDependencies(registryAssets, expandedBundle.assets ?? [])
|
|
35
|
+
: null;
|
|
36
|
+
const belowItems = [];
|
|
37
|
+
// Start at 1 to account for the column header line
|
|
38
|
+
let usedLines = 1;
|
|
39
|
+
// Reserve a line for the "▲ more above" indicator when scrolled
|
|
40
|
+
if (scrollOffset > 0)
|
|
41
|
+
usedLines += 1;
|
|
42
|
+
for (let i = scrollOffset; i < items.length; i++) {
|
|
43
|
+
let expandedLines = 0;
|
|
44
|
+
if (i === expandedIndex) {
|
|
45
|
+
if (expandedBundleDeps && expandedBundle) {
|
|
46
|
+
expandedLines = bundleExpandedLines(expandedBundleDeps, (expandedBundle.assets ?? []).length);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
expandedLines = ASSET_EXPANDED_LINES;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
const linesNeeded = 1 + expandedLines;
|
|
53
|
+
// Reserve a line for the "▼ more below" indicator when there are more items after this one
|
|
54
|
+
const limit = i < items.length - 1 ? viewportHeight - 1 : viewportHeight;
|
|
55
|
+
if (usedLines + linesNeeded > limit)
|
|
56
|
+
break;
|
|
57
|
+
belowItems.push({ index: i, item: items[i] });
|
|
58
|
+
usedLines += linesNeeded;
|
|
59
|
+
}
|
|
60
|
+
const lastVisibleIndex = belowItems.length > 0 ? belowItems[belowItems.length - 1].index : scrollOffset;
|
|
61
|
+
const belowCount = items.length - lastVisibleIndex - 1;
|
|
62
|
+
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [isBundleTab ? (_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: bundleCols.cursor, children: _jsx(Text, { children: " " }) }), _jsx(Box, { flexShrink: 0, width: bundleCols.name, children: _jsx(Text, { bold: true, dimColor: true, children: "Name" }) }), _jsx(Box, { flexShrink: 0, width: bundleCols.assets, children: _jsx(Text, { bold: true, dimColor: true, children: "Assets" }) }), _jsx(Box, { flexShrink: 0, width: bundleCols.version, children: _jsx(Text, { bold: true, dimColor: true, children: "Version" }) }), _jsx(Box, { flexShrink: 0, width: bundleCols.status, children: _jsx(Text, { bold: true, dimColor: true, children: "Status" }) }), _jsx(Box, { flexGrow: 1, overflow: 'hidden', children: _jsx(Text, { bold: true, dimColor: true, children: "Description" }) })] })) : (_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { children: " " }) }), _jsx(Box, { flexShrink: 0, width: cols.name, children: _jsx(Text, { bold: true, dimColor: true, children: "Name" }) }), showType && (_jsx(Box, { flexShrink: 0, width: 'type' in cols ? cols.type : 0, children: _jsx(Text, { bold: true, dimColor: true, children: "Type" }) })), _jsx(Box, { flexShrink: 0, width: cols.version, children: _jsx(Text, { bold: true, dimColor: true, children: "Version" }) }), showTrust && (_jsx(Box, { flexShrink: 0, width: 'trust' in cols ? cols.trust : 0, children: _jsx(Text, { bold: true, dimColor: true, children: "Trust" }) })), _jsx(Box, { flexShrink: 0, width: cols.status, children: _jsx(Text, { bold: true, dimColor: true, children: "Status" }) }), _jsx(Box, { flexGrow: 1, overflow: 'hidden', children: _jsx(Text, { bold: true, dimColor: true, children: "Description" }) })] })), aboveCount > 0 && _jsxs(Text, { dimColor: true, children: [" \u25B2 ", aboveCount, " more above"] }), belowItems.map(({ index, item }) => {
|
|
63
|
+
const isCursor = index === cursorIndex;
|
|
64
|
+
const isExpanded = index === expandedIndex;
|
|
65
|
+
if (item.kind === 'bundle') {
|
|
66
|
+
const bundle = item.data;
|
|
67
|
+
const bundleDeps = index === expandedIndex && expandedBundleDeps
|
|
68
|
+
? expandedBundleDeps
|
|
69
|
+
: resolveBundleDependencies(registryAssets, bundle.assets ?? []);
|
|
70
|
+
const assetLabel = bundleDeps.totalDepCount > 0
|
|
71
|
+
? `${bundle.assetCount} (+${bundleDeps.totalDepCount} deps)`
|
|
72
|
+
: `${bundle.assetCount} assets`;
|
|
73
|
+
const bundleAssets = bundle.assets ?? [];
|
|
74
|
+
const installedCount = bundleAssets.filter((ref) => isAssetInstalled(lockfile, ref.name, ref.type)).length;
|
|
75
|
+
const totalCount = bundleAssets.length;
|
|
76
|
+
const allInstalled = totalCount > 0 && installedCount === totalCount;
|
|
77
|
+
const partiallyInstalled = installedCount > 0 && installedCount < totalCount;
|
|
78
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: isBundleTab ? bundleCols.cursor : cols.cursor, children: _jsx(Text, { color: 'magenta', children: isCursor ? ' ▸' : ' ' }) }), _jsx(Box, { flexShrink: 0, width: isBundleTab ? bundleCols.name : cols.name, children: _jsx(Text, { color: 'magenta', wrap: 'truncate', children: bundle.name }) }), isBundleTab ? (_jsx(Box, { flexShrink: 0, width: bundleCols.assets, children: _jsx(Text, { wrap: 'truncate', children: assetLabel }) })) : (showType && (_jsx(Box, { flexShrink: 0, width: 'type' in cols ? cols.type : 0, children: _jsx(Text, { wrap: 'truncate', children: "bundle" }) }))), _jsx(Box, { flexShrink: 0, width: isBundleTab ? bundleCols.version : cols.version, children: _jsxs(Text, { wrap: 'truncate', children: ["v", bundle.version] }) }), !isBundleTab && showTrust && (_jsx(Box, { flexShrink: 0, width: 'trust' in cols ? cols.trust : 0, children: _jsx(Text, { dimColor: true, children: "--" }) })), _jsxs(Box, { flexShrink: 0, width: isBundleTab ? bundleCols.status : cols.status, children: [allInstalled && _jsx(Text, { color: 'green', children: "[installed]" }), partiallyInstalled && _jsx(Text, { color: 'yellow', children: "[partial]" })] }), _jsx(Box, { flexGrow: 1, overflow: 'hidden', children: _jsx(Text, { dimColor: true, wrap: 'truncate', children: bundle.description }) })] }), isExpanded && (_jsx(BrowseExpandedBundle, { bundle: bundle, bundleDeps: bundleDeps, terminalWidth: terminalWidth }))] }, `bundle/${bundle.name}`));
|
|
79
|
+
}
|
|
80
|
+
const asset = item.data;
|
|
81
|
+
const latestVersion = asset.versions[asset.latest];
|
|
82
|
+
const installed = findInstalledAsset(lockfile, asset.name, asset.type);
|
|
83
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { children: [_jsx(Box, { flexShrink: 0, width: cols.cursor, children: _jsx(Text, { color: 'cyan', children: isCursor ? ' ▸' : ' ' }) }), _jsx(Box, { flexShrink: 0, width: cols.name, children: _jsx(Text, { color: 'cyan', wrap: 'truncate', children: asset.name }) }), showType && (_jsx(Box, { flexShrink: 0, width: 'type' in cols ? cols.type : 0, children: _jsx(Text, { wrap: 'truncate', children: asset.type }) })), _jsx(Box, { flexShrink: 0, width: cols.version, children: _jsxs(Text, { wrap: 'truncate', children: ["v", asset.latest] }) }), showTrust && (_jsx(Box, { flexShrink: 0, width: 'trust' in cols ? cols.trust : 0, children: _jsx(StatusBadge, { level: latestVersion?.trustLevel ?? 'experimental' }) })), _jsx(Box, { flexShrink: 0, width: cols.status, children: installed && _jsx(Text, { color: 'green', children: "[installed]" }) }), _jsx(Box, { flexGrow: 1, overflow: 'hidden', children: _jsx(Text, { dimColor: true, wrap: 'truncate', children: latestVersion?.description ?? '' }) })] }), isExpanded && (_jsx(BrowseExpandedRow, { asset: asset, installedVersion: installed?.version, isInstalled: !!installed, terminalWidth: terminalWidth }))] }, `${asset.type}/${asset.name}`));
|
|
84
|
+
}), belowCount > 0 && _jsxs(Text, { dimColor: true, children: [" \u25BC ", belowCount, " more below"] })] }));
|
|
85
|
+
}
|
|
86
|
+
// Asset expanded row: separator + description + tags/tools + deps/trust + separator = 5
|
|
87
|
+
const ASSET_EXPANDED_LINES = 5;
|
|
88
|
+
function bundleExpandedLines(bundleDeps, assetCount) {
|
|
89
|
+
// separator + description + tags/author + separator = 4
|
|
90
|
+
// If assets: header(1) + assets(N) + rendered dep lines(M)
|
|
91
|
+
if (assetCount === 0)
|
|
92
|
+
return 4;
|
|
93
|
+
// Sum per-asset dep counts from the depMap, since deps shared across assets
|
|
94
|
+
// are rendered under each asset individually (not deduplicated in the UI)
|
|
95
|
+
let renderedDepLines = 0;
|
|
96
|
+
for (const deps of bundleDeps.depMap.values()) {
|
|
97
|
+
renderedDepLines += deps.length;
|
|
98
|
+
}
|
|
99
|
+
return 4 + 1 + assetCount + renderedDepLines;
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=BrowseList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BrowseList.js","sourceRoot":"","sources":["../../src/components/BrowseList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAMhC,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,WAAW,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,oBAAoB,EAAE,EAAmB,yBAAyB,EAA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,CAAC;IACzB,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC;QAC9C,gBAAgB,IAAI,IAAI,CAAC,MAAM,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RegistryBundle } from '../lib/schemas/registry.js';
|
|
2
|
+
interface BundleDetailProps {
|
|
3
|
+
bundle: RegistryBundle;
|
|
4
|
+
}
|
|
5
|
+
export default function BundleDetail({ bundle }: BundleDetailProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=BundleDetail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BundleDetail.d.ts","sourceRoot":"","sources":["../../src/components/BundleDetail.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAKjE,UAAU,iBAAiB;IACzB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,EAAE,iBAAiB,2CAuDjE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text, useStdout } from 'ink';
|
|
3
|
+
import Field from './Field.js';
|
|
4
|
+
import SectionDivider from './SectionDivider.js';
|
|
5
|
+
export default function BundleDetail({ bundle }) {
|
|
6
|
+
const { stdout } = useStdout();
|
|
7
|
+
const terminalWidth = stdout?.columns ?? 120;
|
|
8
|
+
const dividerWidth = Math.max(40, terminalWidth - 6);
|
|
9
|
+
const assets = bundle.assets ?? [];
|
|
10
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', paddingX: 1, children: [_jsx(Text, { bold: true, color: 'cyan', children: bundle.name }), _jsxs(Text, { dimColor: true, children: ["bundle \u00B7 v", bundle.version, " \u00B7 ", bundle.assetCount, " asset", bundle.assetCount !== 1 ? 's' : ''] })] }), _jsx(Box, { marginTop: 1, paddingLeft: 2, children: _jsx(Text, { wrap: 'truncate', children: bundle.description }) }), _jsxs(Box, { flexDirection: 'column', marginTop: 1, paddingLeft: 2, children: [_jsx(Field, { label: 'Author', value: bundle.author }), bundle.tags.length > 0 && (_jsx(Field, { label: 'Tags', children: _jsx(Text, { children: bundle.tags.map((tag, i) => (_jsxs(Text, { children: [i > 0 ? ', ' : '', _jsx(Text, { color: 'blue', children: tag })] }, tag))) }) }))] }), assets.length > 0 && (_jsxs(Box, { flexDirection: 'column', marginTop: 1, children: [_jsx(SectionDivider, { label: `Assets (${assets.length})`, width: dividerWidth }), assets.map((a) => (_jsxs(Text, { children: [' ', a.name, " ", _jsxs(Text, { dimColor: true, children: ["(", a.type, ")"] })] }, `${a.type}/${a.name}`)))] }))] }));
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=BundleDetail.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BundleDetail.js","sourceRoot":"","sources":["../../src/components/BundleDetail.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AAI3C,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,cAAc,MAAM,qBAAqB,CAAC;AAMjD,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAqB;IAChE,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC;IAC/B,MAAM,aAAa,GAAG,MAAM,EAAE,OAAO,IAAI,GAAG,CAAC;IAC7C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,aAAa,GAAG,CAAC,CA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MAAM,CAAC,MAAM,GAAG,CAAC,IAAI,CACpB,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,EAAC,SAAS,EAAE,CAAC,aACtC,KAAC,cAAc,IAAC,KAAK,EAAE,WAAW,MAAM,CAAC,MAAM,GAAG,EAAE,KAAK,EAAE,YAAY,GAAI,EAC1E,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CACjB,MAAC,IAAI,eACF,IAAI,EACJ,CAAC,CAAC,IAAI,OAAE,MAAC,IAAI,IAAC,QAAQ,wBAAG,CAAC,CAAC,IAAI,SAAS,KAFhC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAGzB,CACR,CAAC,IACE,CACP,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DependencyChainNode } from '../lib/lockfile.js';
|
|
2
|
+
interface DependencyTreeProps {
|
|
3
|
+
/** The reverse dependency chain nodes (immediate dependents of the queried asset). */
|
|
4
|
+
chains: DependencyChainNode[];
|
|
5
|
+
/** The queried asset name. */
|
|
6
|
+
name: string;
|
|
7
|
+
/** The queried asset type. */
|
|
8
|
+
type: string;
|
|
9
|
+
/** The queried asset version. */
|
|
10
|
+
version: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Renders a reverse dependency chain as a tree in the terminal.
|
|
14
|
+
* The queried asset is shown as the root node, with its dependents
|
|
15
|
+
* branching upward toward direct-install roots.
|
|
16
|
+
*/
|
|
17
|
+
export default function DependencyTree({ chains, name, type, version }: DependencyTreeProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=DependencyTree.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyTree.d.ts","sourceRoot":"","sources":["../../src/components/DependencyTree.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,UAAU,mBAAmB;IAC3B,sFAAsF;IACtF,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,mBAAmB,2CAwB1F"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Renders a reverse dependency chain as a tree in the terminal.
|
|
5
|
+
* The queried asset is shown as the root node, with its dependents
|
|
6
|
+
* branching upward toward direct-install roots.
|
|
7
|
+
*/
|
|
8
|
+
export default function DependencyTree({ chains, name, type, version }) {
|
|
9
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsx(Text, { bold: true, color: 'cyan', children: name }), _jsxs(Text, { dimColor: true, children: [' ', type, " v", version] })] }), chains.length === 0 ? (_jsx(Text, { dimColor: true, children: " (no dependents found)" })) : (chains.map((node, index) => (_jsx(TreeNode, { isLast: index === chains.length - 1, node: node, prefix: '' }, `${node.type}:${node.name}`))))] }));
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Recursively renders a single node in the dependency tree with
|
|
13
|
+
* proper tree-drawing characters for indentation.
|
|
14
|
+
*/
|
|
15
|
+
function TreeNode({ isLast, node, prefix }) {
|
|
16
|
+
const connector = isLast ? '└── ' : '├── ';
|
|
17
|
+
const childPrefix = prefix + (isLast ? ' ' : '│ ');
|
|
18
|
+
const isDirect = node.installReason === 'direct';
|
|
19
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [prefix, connector, isDirect ? (_jsx(Text, { bold: true, color: 'green', children: node.name })) : (_jsx(Text, { children: node.name })), _jsxs(Text, { dimColor: true, children: [' ', node.type, " v", node.version] }), isDirect && _jsx(Text, { color: 'green', children: " (direct)" })] }), node.children.map((child, index) => (_jsx(TreeNode, { isLast: index === node.children.length - 1, node: child, prefix: childPrefix }, `${child.type}:${child.name}`)))] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=DependencyTree.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DependencyTree.js","sourceRoot":"","sources":["../../src/components/DependencyTree.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAehC;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAuB;IACzF,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aAEzB,MAAC,IAAI,eACH,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,YACpB,IAAI,GACA,EACP,MAAC,IAAI,IAAC,QAAQ,mBACX,GAAG,EACH,IAAI,QAAI,OAAO,IACX,IACF,EAGN,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,CACrB,KAAC,IAAI,IAAC,QAAQ,6CAA8B,CAC7C,CAAC,CAAC,CAAC,CACF,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1B,KAAC,QAAQ,IAAC,MAAM,EAAE,KAAK,KAAK,MAAM,CAAC,MAAM,GAAG,CAAC,EAAoC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAC,EAAE,IAAlD,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,CAA0B,CAC1G,CAAC,CACH,IACG,CACP,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
|
4
|
+
name: string;
|
|
5
|
+
status: 'fail' | 'pass' | 'warn';
|
|
6
|
+
}
|
|
7
|
+
interface DiagnosticListProps {
|
|
8
|
+
/** Array of diagnostic checks to display */
|
|
9
|
+
checks: DiagnosticCheck[];
|
|
10
|
+
/** Title shown above the check list */
|
|
11
|
+
title: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Checklist-style output for `atk doctor` and `atk audit`.
|
|
15
|
+
* Shows pass/warn/fail icons with messages and optional detail lines.
|
|
16
|
+
*/
|
|
17
|
+
export default function DiagnosticList({ checks, title }: DiagnosticListProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=DiagnosticList.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticList.d.ts","sourceRoot":"","sources":["../../src/components/DiagnosticList.tsx"],"names":[],"mappings":"AAIA,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC;AAED,UAAU,mBAAmB;IAC3B,4CAA4C;IAC5C,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,uCAAuC;IACvC,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;;GAGG;AACH,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAuB5E"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { CheckIcon } from './StatusBadge.js';
|
|
4
|
+
/**
|
|
5
|
+
* Checklist-style output for `atk doctor` and `atk audit`.
|
|
6
|
+
* Shows pass/warn/fail icons with messages and optional detail lines.
|
|
7
|
+
*/
|
|
8
|
+
export default function DiagnosticList({ checks, title }) {
|
|
9
|
+
const passCount = checks.filter((c) => c.status === 'pass').length;
|
|
10
|
+
const warnCount = checks.filter((c) => c.status === 'warn').length;
|
|
11
|
+
const failCount = checks.filter((c) => c.status === 'fail').length;
|
|
12
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsx(Text, { bold: true, children: title }), _jsx(Text, { children: " " }), checks.map((check) => (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsx(CheckIcon, { status: check.status }), " ", _jsx(Text, { bold: true, children: check.name }), ' — ', check.message] }), check.detail && _jsxs(Text, { dimColor: true, children: [" ", check.detail] })] }, check.name))), _jsx(Text, { children: " " }), _jsx(DiagnosticSummary, { failCount: failCount, passCount: passCount, warnCount: warnCount })] }));
|
|
13
|
+
}
|
|
14
|
+
function DiagnosticSummary({ failCount, passCount, warnCount, }) {
|
|
15
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [_jsxs(Text, { color: 'green', children: [passCount, " passed"] }), warnCount > 0 && (_jsxs(Text, { children: [",", ' ', _jsxs(Text, { color: 'yellow', children: [warnCount, " ", warnCount === 1 ? 'warning' : 'warnings'] })] })), failCount > 0 && (_jsxs(Text, { children: [", ", _jsxs(Text, { color: 'red', children: [failCount, " failed"] })] }))] }), failCount > 0 && _jsx(Text, { dimColor: true, children: "Fix the failed checks above to ensure atk works correctly." })] }));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=DiagnosticList.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiagnosticList.js","sourceRoot":"","sources":["../../src/components/DiagnosticList.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAgB7C;;;GAGG;AACH,MAAM,CAAC,OAAO,UAA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C,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,eACH,MAAC,IAAI,IAAC,KAAK,EAAC,OAAO,aAAE,SAAS,eAAe,EAC5C,SAAS,GAAG,CAAC,IAAI,CAChB,MAAC,IAAI,oBACD,GAAG,EACL,MAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,aACjB,SAAS,OAAG,SAAS,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAChD,IACF,CACR,EACA,SAAS,GAAG,CAAC,IAAI,CAChB,MAAC,IAAI,qBACD,MAAC,IAAI,IAAC,KAAK,EAAC,KAAK,aAAE,SAAS,eAAe,IACxC,CACR,IACI,EACN,SAAS,GAAG,CAAC,IAAI,KAAC,IAAI,IAAC,QAAQ,iFAAkE,IAC9F,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DiffLine } from '../lib/diff.js';
|
|
2
|
+
export interface FileDiffEntry {
|
|
3
|
+
diffLines?: DiffLine[];
|
|
4
|
+
fileName: string;
|
|
5
|
+
localLines?: number;
|
|
6
|
+
remoteLines?: number;
|
|
7
|
+
status: 'added' | 'missing-local' | 'modified' | 'removed' | 'unchanged';
|
|
8
|
+
}
|
|
9
|
+
interface DiffViewProps {
|
|
10
|
+
/** Number of context lines to show around changes in unified diff output */
|
|
11
|
+
contextLines?: number;
|
|
12
|
+
/** Array of file-level diffs */
|
|
13
|
+
diffs: FileDiffEntry[];
|
|
14
|
+
/** Installed version string */
|
|
15
|
+
installedVersion: string;
|
|
16
|
+
/** Latest registry version string */
|
|
17
|
+
latestVersion: string;
|
|
18
|
+
/** Asset name being diffed */
|
|
19
|
+
name: string;
|
|
20
|
+
/** Whether versions are the same */
|
|
21
|
+
sameVersion: boolean;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Diff display for `atk diff` — shows file-level changes between
|
|
25
|
+
* installed and latest registry version of an asset, with inline
|
|
26
|
+
* unified diff output for modified, added, and removed files.
|
|
27
|
+
*/
|
|
28
|
+
export default function DiffView({ diffs, installedVersion, latestVersion, name, sameVersion }: DiffViewProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export {};
|
|
30
|
+
//# sourceMappingURL=DiffView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffView.d.ts","sourceRoot":"","sources":["../../src/components/DiffView.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAI/C,MAAM,WAAW,aAAa;IAC5B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,OAAO,GAAG,eAAe,GAAG,UAAU,GAAG,SAAS,GAAG,WAAW,CAAC;CAC1E;AAED,UAAU,aAAa;IACrB,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,+BAA+B;IAC/B,gBAAgB,EAAE,MAAM,CAAC;IACzB,qCAAqC;IACrC,aAAa,EAAE,MAAM,CAAC;IACtB,8BAA8B;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;CACtB;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAE,EAAE,aAAa,2CAyD5G"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { FileStatusIcon } from './StatusBadge.js';
|
|
4
|
+
/**
|
|
5
|
+
* Diff display for `atk diff` — shows file-level changes between
|
|
6
|
+
* installed and latest registry version of an asset, with inline
|
|
7
|
+
* unified diff output for modified, added, and removed files.
|
|
8
|
+
*/
|
|
9
|
+
export default function DiffView({ diffs, installedVersion, latestVersion, name, sameVersion }) {
|
|
10
|
+
const hasChanges = diffs.some((d) => d.status !== 'unchanged');
|
|
11
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { bold: true, children: ["Diff for ", _jsx(Text, { color: 'cyan', children: name })] }), _jsxs(Text, { children: ["Installed: ", _jsxs(Text, { color: sameVersion ? 'green' : 'red', children: ["v", installedVersion] }), ' → ', "Latest: ", _jsxs(Text, { color: 'green', children: ["v", latestVersion] }), sameVersion && _jsx(Text, { dimColor: true, children: " (same version)" })] }), _jsx(Text, { children: " " }), !hasChanges ? (_jsx(Text, { color: 'green', children: "\u2713 No differences found. Local files match the registry." })) : (_jsxs(_Fragment, { children: [diffs.map((diff, index) => {
|
|
12
|
+
const hasDiffLines = diff.diffLines && diff.diffLines.length > 0;
|
|
13
|
+
const isLastEntry = index === diffs.length - 1;
|
|
14
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsxs(Text, { children: [' ', _jsx(FileStatusIcon, { status: diff.status }), " ", diff.fileName, diff.status === 'modified' && (_jsxs(Text, { dimColor: true, children: [' ', "(", diff.localLines, " lines local, ", diff.remoteLines, " lines remote)"] })), diff.status === 'added' && _jsx(Text, { dimColor: true, children: " (new in registry)" }), diff.status === 'removed' && _jsx(Text, { dimColor: true, children: " (removed from registry)" }), diff.status === 'missing-local' && _jsx(Text, { dimColor: true, children: " (file missing locally)" })] }), hasDiffLines && (_jsx(Box, { flexDirection: 'column', paddingLeft: 4, children: diff.diffLines.map((line, lineIndex) => (_jsx(DiffLineView, { line: line }, lineIndex))) })), hasDiffLines && !isLastEntry && _jsx(Text, { children: " " })] }, diff.fileName));
|
|
15
|
+
}), _jsx(Text, { children: " " }), _jsxs(Text, { dimColor: true, children: ["Run ", _jsxs(Text, { bold: true, children: ["atk update ", name] }), " to update to the latest version."] })] }))] }));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Renders a single diff line with appropriate color and prefix based on its type.
|
|
19
|
+
*/
|
|
20
|
+
function DiffLineView({ line }) {
|
|
21
|
+
switch (line.type) {
|
|
22
|
+
case 'addition':
|
|
23
|
+
return _jsx(Text, { color: 'green', children: '+ ' + line.content });
|
|
24
|
+
case 'context':
|
|
25
|
+
return _jsx(Text, { dimColor: true, children: ' ' + line.content });
|
|
26
|
+
case 'deletion':
|
|
27
|
+
return _jsx(Text, { color: 'red', children: '- ' + line.content });
|
|
28
|
+
case 'hunk-header':
|
|
29
|
+
return (_jsx(Text, { bold: true, color: 'cyan', children: line.content }));
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=DiffView.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DiffView.js","sourceRoot":"","sources":["../../src/components/DiffView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAIhC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAyBlD;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,IAAI,EAAE,WAAW,EAAiB;IAC3G,MAAM,UAAU,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC;IAE/D,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,MAAC,IAAI,IAAC,IAAI,gCACC,KAAC,IAAI,IAAC,KAAK,EAAC,MAAM,YAAE,IAAI,GAAQ,IACpC,EACP,MAAC,IAAI,8BACQ,MAAC,IAAI,IAAC,KAAK,EAAE,WAAW,CAAC,CAA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,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CACxC,KAAC,YAAY,IAAiB,IAAI,EAAE,IAAI,IAArB,SAAS,CAAgB,CAC7C,CAAC,GACE,CACP,EACA,YAAY,IAAI,CAAC,WAAW,IAAI,KAAC,IAAI,oBAAS,KArBhB,IAAI,CAAC,QAAQ,CAsBxC,CACP,CAAC;oBACJ,CAAC,CAAC,EACF,KAAC,IAAI,oBAAS,EACd,MAAC,IAAI,IAAC,QAAQ,2BACR,MAAC,IAAI,IAAC,IAAI,kCAAa,IAAI,IAAQ,yCAClC,IACN,CACJ,IACG,CACP,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,SAAS,YAAY,CAAC,EAAE,IAAI,EAAsB;IAChD,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,UAAU;YACb,OAAO,KAAC,IAAI,IAAC,KAAK,EAAC,OAAO,YAAE,IAAI,GAAG,IAAI,CAAC,OAAO,GAAQ,CAAC;QAC1D,KAAK,SAAS;YACZ,OAAO,KAAC,IAAI,IAAC,QAAQ,kBAAE,IAAI,GAAG,IAAI,CAAC,OAAO,GAAQ,CAAC;QACrD,KAAK,UAAU;YACb,OAAO,KAAC,IAAI,IAAC,KAAK,EAAC,KAAK,YAAE,IAAI,GAAG,IAAI,CAAC,OAAO,GAAQ,CAAC;QACxD,KAAK,aAAa;YAChB,OAAO,CACL,KAAC,IAAI,IAAC,IAAI,QAAC,KAAK,EAAC,MAAM,YACpB,IAAI,CAAC,OAAO,GACR,CACR,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface DryRunBannerProps {
|
|
2
|
+
/** The action verb (e.g., "install", "update", "uninstall", "sync") */
|
|
3
|
+
action: string;
|
|
4
|
+
/** Number of assets affected */
|
|
5
|
+
count: number;
|
|
6
|
+
/** Target tool name (e.g., "claude-code") */
|
|
7
|
+
tool: string;
|
|
8
|
+
}
|
|
9
|
+
export default function DryRunBanner({ action, count, tool }: DryRunBannerProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=DryRunBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DryRunBanner.d.ts","sourceRoot":"","sources":["../../src/components/DryRunBanner.tsx"],"names":[],"mappings":"AAEA,UAAU,iBAAiB;IACzB,uEAAuE;IACvE,MAAM,EAAE,MAAM,CAAC;IACf,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,iBAAiB,2CAa9E"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
export default function DryRunBanner({ action, count, tool }) {
|
|
4
|
+
return (_jsxs(Box, { flexDirection: 'column', children: [_jsx(Text, { color: 'yellow', children: "~ Dry run \u2014 no changes will be made" }), _jsxs(Text, { children: ["Would ", action, ' ', _jsxs(Text, { bold: true, children: [count, " asset", count !== 1 ? 's' : ''] }), ' ', "for ", tool, ":"] })] }));
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=DryRunBanner.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DryRunBanner.js","sourceRoot":"","sources":["../../src/components/DryRunBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAWhC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAqB;IAC7E,OAAO,CACL,MAAC,GAAG,IAAC,aAAa,EAAC,QAAQ,aACzB,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,yDAA2C,EAC/D,MAAC,IAAI,yBACI,MAAM,EAAE,GAAG,EAClB,MAAC,IAAI,IAAC,IAAI,mBACP,KAAK,YAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,IAC/B,EAAC,GAAG,UACN,IAAI,SACJ,IACH,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Metadata field with consistent label width alignment.
|
|
4
|
+
*/
|
|
5
|
+
export default function Field({ children, color, dimValue, label, value, }: {
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
color?: string;
|
|
8
|
+
dimValue?: boolean;
|
|
9
|
+
label: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/components/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,GACN,EAAE;IACD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CAaA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
/**
|
|
4
|
+
* Metadata field with consistent label width alignment.
|
|
5
|
+
*/
|
|
6
|
+
export default function Field({ children, color, dimValue, label, value, }) {
|
|
7
|
+
return (_jsxs(Box, { children: [_jsx(Box, { width: 14, children: _jsxs(Text, { bold: true, children: [label, ":"] }) }), children ?? (_jsx(Text, { color: color, dimColor: dimValue, wrap: 'truncate', children: value }))] }));
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=Field.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.js","sourceRoot":"","sources":["../../src/components/Field.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAC;AAEhC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,QAAQ,EACR,KAAK,EACL,QAAQ,EACR,KAAK,EACL,KAAK,GAON;IACC,OAAO,CACL,MAAC,GAAG,eACF,KAAC,GAAG,IAAC,KAAK,EAAE,EAAE,YACZ,MAAC,IAAI,IAAC,IAAI,mBAAE,KAAK,SAAS,GACtB,EACL,QAAQ,IAAI,CACX,KAAC,IAAI,IAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAC,UAAU,YACpD,KAAK,GACD,CACR,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type AssetTypeFilter } from '../hooks/useBrowseState.js';
|
|
2
|
+
interface FilterBarProps {
|
|
3
|
+
/** Current filter text */
|
|
4
|
+
filterText: string;
|
|
5
|
+
/** Whether in filter input mode */
|
|
6
|
+
inputMode: 'filter' | 'navigate';
|
|
7
|
+
/** Number of items matching current filters */
|
|
8
|
+
resultCount: number;
|
|
9
|
+
/** Terminal width for responsive layout */
|
|
10
|
+
terminalWidth: number;
|
|
11
|
+
/** Total number of items in registry */
|
|
12
|
+
totalCount: number;
|
|
13
|
+
/** Active type tab */
|
|
14
|
+
typeFilter: AssetTypeFilter;
|
|
15
|
+
}
|
|
16
|
+
export default function FilterBar({ filterText, inputMode, resultCount, terminalWidth, totalCount, typeFilter, }: FilterBarProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=FilterBar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FilterBar.d.ts","sourceRoot":"","sources":["../../src/components/FilterBar.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAA8B,MAAM,4BAA4B,CAAC;AAa9F,UAAU,cAAc;IACtB,0BAA0B;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,mCAAmC;IACnC,SAAS,EAAE,QAAQ,GAAG,UAAU,CAAC;IACjC,+CAA+C;IAC/C,WAAW,EAAE,MAAM,CAAC;IACpB,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAC;IACtB,wCAAwC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,UAAU,EAAE,eAAe,CAAC;CAC7B;AAED,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,UAAU,EACV,SAAS,EACT,WAAW,EACX,aAAa,EACb,UAAU,EACV,UAAU,GACX,EAAE,cAAc,2CAuChB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Box, Text } from 'ink';
|
|
3
|
+
import { TYPE_TAB_LABELS, TYPE_TABS } from '../hooks/useBrowseState.js';
|
|
4
|
+
const ABBREVIATED_TAB_LABELS = {
|
|
5
|
+
agent: 'Agent',
|
|
6
|
+
all: 'All',
|
|
7
|
+
bundle: 'Bundle',
|
|
8
|
+
hook: 'Hook',
|
|
9
|
+
'mcp-config': 'MCP',
|
|
10
|
+
'memory-template': 'Mem',
|
|
11
|
+
rule: 'Rule',
|
|
12
|
+
skill: 'Skill',
|
|
13
|
+
};
|
|
14
|
+
export default function FilterBar({ filterText, inputMode, resultCount, terminalWidth, totalCount, typeFilter, }) {
|
|
15
|
+
const counterLabel = typeFilter === 'bundle' ? 'bundles' : typeFilter === 'all' ? 'items' : 'assets';
|
|
16
|
+
return (_jsxs(Box, { borderColor: 'gray', borderStyle: 'round', flexDirection: 'column', children: [_jsxs(Box, { children: [_jsxs(Text, { children: [_jsx(Text, { dimColor: true, children: "Filter: " }), filterText ? (_jsx(Text, { children: filterText })) : inputMode === 'filter' ? (_jsx(Text, { dimColor: true, children: "type to filter..." })) : (_jsx(Text, { dimColor: true, children: "press / to filter" })), inputMode === 'filter' && _jsx(Text, { color: 'cyan', children: "|" })] }), _jsx(Box, { flexGrow: 1 }), _jsxs(Text, { dimColor: true, children: [resultCount, "/", totalCount, " ", counterLabel] })] }), _jsx(Box, { gap: 1, children: TYPE_TABS.map((tab) => {
|
|
17
|
+
const label = terminalWidth < 80 ? ABBREVIATED_TAB_LABELS[tab] : TYPE_TAB_LABELS[tab];
|
|
18
|
+
return (_jsxs(Text, { bold: tab === typeFilter, color: tab === typeFilter ? 'cyan' : undefined, dimColor: tab !== typeFilter, children: ["[", label, "]"] }, tab));
|
|
19
|
+
}) })] }));
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=FilterBar.js.map
|