@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,195 @@
|
|
|
1
|
+
import { getGitHubToken, isGhCliAvailable, validateToken } from './auth.js';
|
|
2
|
+
import { loadConfig } from './config.js';
|
|
3
|
+
import { detectTools, getAdapterDiagnostics } from './detector.js';
|
|
4
|
+
import { readLockfile } from './lockfile.js';
|
|
5
|
+
import { findProjectRoot } from './paths.js';
|
|
6
|
+
import { fetchRegistry } from './registry.js';
|
|
7
|
+
/**
|
|
8
|
+
* Run all environment diagnostic checks and return the results.
|
|
9
|
+
* Extracted from the `doctor` command so it can be tested independently.
|
|
10
|
+
*
|
|
11
|
+
* @param progress - callback to report progress messages
|
|
12
|
+
* @param projectRootOverride - optional explicit project root; when omitted, discovered via `findProjectRoot()`
|
|
13
|
+
*/
|
|
14
|
+
export async function runDiagnostics(progress, projectRootOverride) {
|
|
15
|
+
const projectDir = findProjectRoot(projectRootOverride);
|
|
16
|
+
const checks = [];
|
|
17
|
+
// Check Node.js version
|
|
18
|
+
progress('Checking Node.js...');
|
|
19
|
+
const nodeVersion = process.version;
|
|
20
|
+
const nodeMajor = parseInt(nodeVersion.slice(1), 10);
|
|
21
|
+
if (nodeMajor >= 24) {
|
|
22
|
+
checks.push({
|
|
23
|
+
message: `${nodeVersion} (recommended)`,
|
|
24
|
+
name: 'Node.js',
|
|
25
|
+
status: 'pass',
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
else if (nodeMajor >= 20) {
|
|
29
|
+
checks.push({
|
|
30
|
+
message: `${nodeVersion} (Node 24+ recommended)`,
|
|
31
|
+
name: 'Node.js',
|
|
32
|
+
status: 'warn',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
checks.push({
|
|
37
|
+
message: `${nodeVersion} (Node 20+ required, 24+ recommended)`,
|
|
38
|
+
name: 'Node.js',
|
|
39
|
+
status: 'fail',
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
// Check gh CLI
|
|
43
|
+
progress('Checking GitHub CLI...');
|
|
44
|
+
const ghAvailable = await isGhCliAvailable();
|
|
45
|
+
if (ghAvailable) {
|
|
46
|
+
checks.push({
|
|
47
|
+
message: 'Installed and available',
|
|
48
|
+
name: 'GitHub CLI (gh)',
|
|
49
|
+
status: 'pass',
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
checks.push({
|
|
54
|
+
detail: 'Install from https://cli.github.com or set githubToken in config.',
|
|
55
|
+
message: 'Not found — needed for auto-auth',
|
|
56
|
+
name: 'GitHub CLI (gh)',
|
|
57
|
+
status: 'warn',
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
// Check GitHub auth
|
|
61
|
+
progress('Checking GitHub authentication...');
|
|
62
|
+
try {
|
|
63
|
+
const token = await getGitHubToken();
|
|
64
|
+
const validation = await validateToken(token);
|
|
65
|
+
if (validation.valid) {
|
|
66
|
+
checks.push({
|
|
67
|
+
message: `Authenticated as ${validation.username ?? 'unknown'}`,
|
|
68
|
+
name: 'GitHub auth',
|
|
69
|
+
status: 'pass',
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
checks.push({
|
|
74
|
+
detail: 'Run `gh auth login` or update githubToken in config.',
|
|
75
|
+
message: 'Token is invalid or expired',
|
|
76
|
+
name: 'GitHub auth',
|
|
77
|
+
status: 'fail',
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
catch (err) {
|
|
82
|
+
checks.push({
|
|
83
|
+
message: err instanceof Error ? err.message : 'Failed to get token',
|
|
84
|
+
name: 'GitHub auth',
|
|
85
|
+
status: 'fail',
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
// Check user config
|
|
89
|
+
progress('Checking configuration...');
|
|
90
|
+
let config = null;
|
|
91
|
+
try {
|
|
92
|
+
config = await loadConfig();
|
|
93
|
+
checks.push({
|
|
94
|
+
message: `Loaded (tool: ${config.defaultTool ?? 'claude-code'})`,
|
|
95
|
+
name: 'Config',
|
|
96
|
+
status: 'pass',
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
catch (err) {
|
|
100
|
+
checks.push({
|
|
101
|
+
message: err instanceof Error ? err.message : 'Failed to load config',
|
|
102
|
+
name: 'Config',
|
|
103
|
+
status: 'fail',
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
// Check registry access
|
|
107
|
+
progress('Checking registry access...');
|
|
108
|
+
try {
|
|
109
|
+
const registry = await fetchRegistry({ force: true });
|
|
110
|
+
checks.push({
|
|
111
|
+
message: `Accessible (${registry.assets.length} assets, ${(registry.bundles ?? []).length} bundles)`,
|
|
112
|
+
name: 'Registry',
|
|
113
|
+
status: 'pass',
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
catch (err) {
|
|
117
|
+
checks.push({
|
|
118
|
+
message: err instanceof Error ? err.message : 'Failed to fetch registry',
|
|
119
|
+
name: 'Registry',
|
|
120
|
+
status: 'fail',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
// Check tool detection
|
|
124
|
+
progress('Detecting tools...');
|
|
125
|
+
const detectedTools = await detectTools(projectDir);
|
|
126
|
+
if (detectedTools.length > 0) {
|
|
127
|
+
const toolNames = detectedTools.map((t) => `${t.displayName} (${t.confidence})`).join(', ');
|
|
128
|
+
checks.push({
|
|
129
|
+
message: toolNames,
|
|
130
|
+
name: 'Tool detection',
|
|
131
|
+
status: 'pass',
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
else if (config?.defaultTool) {
|
|
135
|
+
checks.push({
|
|
136
|
+
message: `${config.defaultTool} (configured default — not auto-detected in project)`,
|
|
137
|
+
name: 'Tool detection',
|
|
138
|
+
status: 'pass',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
checks.push({
|
|
143
|
+
detail: 'Use --tool flag, set defaultTool in config, or run from a project with a supported tool.',
|
|
144
|
+
message: 'No agentic tool detected in current directory',
|
|
145
|
+
name: 'Tool detection',
|
|
146
|
+
status: 'warn',
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
// Check adapter loading
|
|
150
|
+
progress('Checking adapters...');
|
|
151
|
+
const adapterDiag = await getAdapterDiagnostics();
|
|
152
|
+
if (!adapterDiag.directoryExists) {
|
|
153
|
+
checks.push({
|
|
154
|
+
message: `Adapters directory not found at: ${adapterDiag.adaptersDir}`,
|
|
155
|
+
name: 'Adapters',
|
|
156
|
+
status: 'warn',
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
else if (adapterDiag.failures.length > 0) {
|
|
160
|
+
const failDetails = adapterDiag.failures.map((f) => `${f.filename}: ${f.reason}`).join('; ');
|
|
161
|
+
checks.push({
|
|
162
|
+
detail: failDetails,
|
|
163
|
+
message: `${adapterDiag.failures.length} adapter(s) failed to load`,
|
|
164
|
+
name: 'Adapters',
|
|
165
|
+
status: 'warn',
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
checks.push({
|
|
170
|
+
message: `${adapterDiag.adaptersLoaded} adapter(s) loaded`,
|
|
171
|
+
name: 'Adapters',
|
|
172
|
+
status: 'pass',
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
// Check lockfile
|
|
176
|
+
progress('Checking lockfile...');
|
|
177
|
+
try {
|
|
178
|
+
const defaultTool = config?.defaultTool ?? 'claude-code';
|
|
179
|
+
const lockfile = await readLockfile(projectDir, defaultTool);
|
|
180
|
+
checks.push({
|
|
181
|
+
message: `Valid (${(lockfile.assets ?? []).length} assets installed)`,
|
|
182
|
+
name: 'Lockfile',
|
|
183
|
+
status: 'pass',
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
catch (err) {
|
|
187
|
+
checks.push({
|
|
188
|
+
message: err instanceof Error ? err.message : 'No lockfile found',
|
|
189
|
+
name: 'Lockfile',
|
|
190
|
+
status: 'warn',
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
return checks;
|
|
194
|
+
}
|
|
195
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diagnostics.js","sourceRoot":"","sources":["../../src/lib/diagnostics.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC5E,OAAO,EAAE,UAAU,EAAE,MAAM,aAA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IAAI,CAAC,CAAC;QAC7F,MAAM,CAAC,IAAI,CAAC;YACV,MAAM,EAAE,WAAW;YACnB,OAAO,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC,MAAM,4BAA4B;YACnE,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,GAAG,WAAW,CAAC,cAAc,oBAAoB;YAC1D,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB;IACjB,QAAQ,CAAC,sBAAsB,CAAC,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,MAAM,EAAE,WAAW,IAAI,aAAa,CAAC;QACzD,MAAM,QAAQ,GAAG,MAAM,YAAY,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;QAC7D,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC,MAAM,IAAI,EAAE,CAAC,CAAC,MAAM,oBAAoB;YACrE,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,MAAM,CAAC,IAAI,CAAC;YACV,OAAO,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB;YACjE,IAAI,EAAE,UAAU;YAChB,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A single line in a unified diff, with its type and text content.
|
|
3
|
+
* The `content` field does NOT include the prefix character (+, -, or space).
|
|
4
|
+
*/
|
|
5
|
+
export interface DiffLine {
|
|
6
|
+
content: string;
|
|
7
|
+
type: DiffLineType;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* The type of a line in a unified diff output.
|
|
11
|
+
*/
|
|
12
|
+
export type DiffLineType = 'addition' | 'context' | 'deletion' | 'hunk-header';
|
|
13
|
+
/**
|
|
14
|
+
* Produce diff lines for a completely new file (all lines are additions).
|
|
15
|
+
*
|
|
16
|
+
* @param content - The full content of the added file.
|
|
17
|
+
*/
|
|
18
|
+
export declare function computeAddedFileDiff(content: string): DiffLine[];
|
|
19
|
+
/**
|
|
20
|
+
* Produce diff lines for a completely removed file (all lines are deletions).
|
|
21
|
+
*
|
|
22
|
+
* @param content - The full content of the removed file.
|
|
23
|
+
*/
|
|
24
|
+
export declare function computeRemovedFileDiff(content: string): DiffLine[];
|
|
25
|
+
/**
|
|
26
|
+
* Compute a unified diff between two strings.
|
|
27
|
+
* Returns an array of typed diff lines including hunk headers, context, additions, and deletions.
|
|
28
|
+
*
|
|
29
|
+
* @param oldContent - The original file content.
|
|
30
|
+
* @param newContent - The new file content.
|
|
31
|
+
* @param contextLines - Number of context lines surrounding each change (default: 3).
|
|
32
|
+
*/
|
|
33
|
+
export declare function computeUnifiedDiff(oldContent: string, newContent: string, contextLines?: number): DiffLine[];
|
|
34
|
+
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/lib/diff.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,YAAY,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,CAAC;AAE/E;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAmBhE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,QAAQ,EAAE,CAmBlE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,GAAE,MAAU,GAAG,QAAQ,EAAE,CA4B/G"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { structuredPatch } from 'diff';
|
|
2
|
+
/**
|
|
3
|
+
* Produce diff lines for a completely new file (all lines are additions).
|
|
4
|
+
*
|
|
5
|
+
* @param content - The full content of the added file.
|
|
6
|
+
*/
|
|
7
|
+
export function computeAddedFileDiff(content) {
|
|
8
|
+
const contentLines = content.split('\n');
|
|
9
|
+
// Remove trailing empty string from a final newline
|
|
10
|
+
if (contentLines.length > 0 && contentLines[contentLines.length - 1] === '') {
|
|
11
|
+
contentLines.pop();
|
|
12
|
+
}
|
|
13
|
+
const lines = [];
|
|
14
|
+
lines.push({
|
|
15
|
+
content: `@@ -0,0 +1,${contentLines.length} @@`,
|
|
16
|
+
type: 'hunk-header',
|
|
17
|
+
});
|
|
18
|
+
for (const line of contentLines) {
|
|
19
|
+
lines.push({ content: line, type: 'addition' });
|
|
20
|
+
}
|
|
21
|
+
return lines;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Produce diff lines for a completely removed file (all lines are deletions).
|
|
25
|
+
*
|
|
26
|
+
* @param content - The full content of the removed file.
|
|
27
|
+
*/
|
|
28
|
+
export function computeRemovedFileDiff(content) {
|
|
29
|
+
const contentLines = content.split('\n');
|
|
30
|
+
// Remove trailing empty string from a final newline
|
|
31
|
+
if (contentLines.length > 0 && contentLines[contentLines.length - 1] === '') {
|
|
32
|
+
contentLines.pop();
|
|
33
|
+
}
|
|
34
|
+
const lines = [];
|
|
35
|
+
lines.push({
|
|
36
|
+
content: `@@ -1,${contentLines.length} +0,0 @@`,
|
|
37
|
+
type: 'hunk-header',
|
|
38
|
+
});
|
|
39
|
+
for (const line of contentLines) {
|
|
40
|
+
lines.push({ content: line, type: 'deletion' });
|
|
41
|
+
}
|
|
42
|
+
return lines;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Compute a unified diff between two strings.
|
|
46
|
+
* Returns an array of typed diff lines including hunk headers, context, additions, and deletions.
|
|
47
|
+
*
|
|
48
|
+
* @param oldContent - The original file content.
|
|
49
|
+
* @param newContent - The new file content.
|
|
50
|
+
* @param contextLines - Number of context lines surrounding each change (default: 3).
|
|
51
|
+
*/
|
|
52
|
+
export function computeUnifiedDiff(oldContent, newContent, contextLines = 3) {
|
|
53
|
+
const patch = structuredPatch('a', 'b', oldContent, newContent, undefined, undefined, {
|
|
54
|
+
context: contextLines,
|
|
55
|
+
});
|
|
56
|
+
const lines = [];
|
|
57
|
+
for (const hunk of patch.hunks) {
|
|
58
|
+
lines.push({
|
|
59
|
+
content: `@@ -${hunk.oldStart},${hunk.oldLines} +${hunk.newStart},${hunk.newLines} @@`,
|
|
60
|
+
type: 'hunk-header',
|
|
61
|
+
});
|
|
62
|
+
for (const line of hunk.lines) {
|
|
63
|
+
const prefix = line[0];
|
|
64
|
+
const text = line.slice(1);
|
|
65
|
+
if (prefix === '+') {
|
|
66
|
+
lines.push({ content: text, type: 'addition' });
|
|
67
|
+
}
|
|
68
|
+
else if (prefix === '-') {
|
|
69
|
+
lines.push({ content: text, type: 'deletion' });
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
lines.push({ content: text, type: 'context' });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return lines;
|
|
77
|
+
}
|
|
78
|
+
//# sourceMappingURL=diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"diff.js","sourceRoot":"","sources":["../../src/lib/diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAgBvC;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe;IAClD,MAAM,YAAY,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
+
/**
|
|
2
|
+
* Fetch wrapper with automatic retry for transient failures.
|
|
3
|
+
*
|
|
4
|
+
* Retries on network errors and retryable HTTP status codes (429, 500, 502, 503, 504)
|
|
5
|
+
* using exponential backoff with randomized jitter. Respects Retry-After headers
|
|
6
|
+
* from 429 responses when present.
|
|
7
|
+
*/
|
|
8
|
+
/** Configurable options for retry behavior. */
|
|
9
|
+
export interface RetryOptions {
|
|
10
|
+
/** Base delay in milliseconds before the first retry (default: 1000). */
|
|
11
|
+
baseDelayMs?: number;
|
|
12
|
+
/** Whether to apply randomized jitter to the delay (default: true). */
|
|
13
|
+
jitter?: boolean;
|
|
14
|
+
/** Maximum delay cap in milliseconds (default: 10000). */
|
|
15
|
+
maxDelayMs?: number;
|
|
16
|
+
/** Maximum number of retry attempts (default: 3). */
|
|
17
|
+
maxRetries?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Fetch with automatic retry for transient failures.
|
|
21
|
+
*
|
|
22
|
+
* Wraps the standard `fetch` API and retries on:
|
|
23
|
+
* - Network errors (fetch throws)
|
|
24
|
+
* - Retryable HTTP status codes: 429, 500, 502, 503, 504
|
|
25
|
+
*
|
|
26
|
+
* Non-retryable responses (e.g. 400, 401, 403, 404) are returned immediately
|
|
27
|
+
* without retry.
|
|
28
|
+
*
|
|
29
|
+
* @param url - The URL to fetch
|
|
30
|
+
* @param init - Standard fetch RequestInit options
|
|
31
|
+
* @param retryOptions - Configurable retry behavior
|
|
32
|
+
* @returns The fetch Response
|
|
33
|
+
* @throws The last network error if all retry attempts fail
|
|
34
|
+
*/
|
|
35
|
+
export declare function fetchWithRetry(url: string | URL, init?: RequestInit, retryOptions?: RetryOptions): Promise<Response>;
|
|
36
|
+
/**
|
|
37
|
+
* Check whether an HTTP status code is retryable (transient failure).
|
|
38
|
+
*
|
|
39
|
+
* Retryable statuses: 429 (Too Many Requests), 500 (Internal Server Error),
|
|
40
|
+
* 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout).
|
|
41
|
+
*/
|
|
42
|
+
export declare function isRetryableStatus(status: number): boolean;
|
|
43
|
+
//# sourceMappingURL=fetch-retry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-retry.d.ts","sourceRoot":"","sources":["../../src/lib/fetch-retry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B,yEAAyE;IACzE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0DAA0D;IAC1D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAYD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,cAAc,CAClC,GAAG,EAAE,MAAM,GAAG,GAAG,EACjB,IAAI,CAAC,EAAE,WAAW,EAClB,YAAY,CAAC,EAAE,YAAY,GAC1B,OAAO,CAAC,QAAQ,CAAC,CA+CnB;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAEzD"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fetch wrapper with automatic retry for transient failures.
|
|
3
|
+
*
|
|
4
|
+
* Retries on network errors and retryable HTTP status codes (429, 500, 502, 503, 504)
|
|
5
|
+
* using exponential backoff with randomized jitter. Respects Retry-After headers
|
|
6
|
+
* from 429 responses when present.
|
|
7
|
+
*/
|
|
8
|
+
const DEFAULT_OPTIONS = {
|
|
9
|
+
baseDelayMs: 1_000,
|
|
10
|
+
jitter: true,
|
|
11
|
+
maxDelayMs: 10_000,
|
|
12
|
+
maxRetries: 3,
|
|
13
|
+
};
|
|
14
|
+
/** HTTP status codes that indicate a transient/retryable failure. */
|
|
15
|
+
const RETRYABLE_STATUS_CODES = new Set([429, 500, 502, 503, 504]);
|
|
16
|
+
/**
|
|
17
|
+
* Fetch with automatic retry for transient failures.
|
|
18
|
+
*
|
|
19
|
+
* Wraps the standard `fetch` API and retries on:
|
|
20
|
+
* - Network errors (fetch throws)
|
|
21
|
+
* - Retryable HTTP status codes: 429, 500, 502, 503, 504
|
|
22
|
+
*
|
|
23
|
+
* Non-retryable responses (e.g. 400, 401, 403, 404) are returned immediately
|
|
24
|
+
* without retry.
|
|
25
|
+
*
|
|
26
|
+
* @param url - The URL to fetch
|
|
27
|
+
* @param init - Standard fetch RequestInit options
|
|
28
|
+
* @param retryOptions - Configurable retry behavior
|
|
29
|
+
* @returns The fetch Response
|
|
30
|
+
* @throws The last network error if all retry attempts fail
|
|
31
|
+
*/
|
|
32
|
+
export async function fetchWithRetry(url, init, retryOptions) {
|
|
33
|
+
const options = { ...DEFAULT_OPTIONS, ...retryOptions };
|
|
34
|
+
const signal = init?.signal ?? null;
|
|
35
|
+
let lastError;
|
|
36
|
+
for (let attempt = 0; attempt <= options.maxRetries; attempt++) {
|
|
37
|
+
try {
|
|
38
|
+
const response = await fetch(url, init);
|
|
39
|
+
// Non-retryable status — return immediately
|
|
40
|
+
if (response.ok || !isRetryableStatus(response.status)) {
|
|
41
|
+
return response;
|
|
42
|
+
}
|
|
43
|
+
// Retryable status — retry if attempts remain
|
|
44
|
+
if (attempt < options.maxRetries) {
|
|
45
|
+
const retryAfterMs = response.status === 429 ? parseRetryAfter(response) : null;
|
|
46
|
+
const delay = retryAfterMs ?? computeDelay(attempt, options);
|
|
47
|
+
await sleep(delay, signal);
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
// All retries exhausted — return the last retryable response
|
|
51
|
+
return response;
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
lastError = error;
|
|
55
|
+
// If the caller's signal was aborted, propagate immediately
|
|
56
|
+
if (signal?.aborted) {
|
|
57
|
+
throw error;
|
|
58
|
+
}
|
|
59
|
+
// Network error — retry if attempts remain
|
|
60
|
+
if (attempt < options.maxRetries) {
|
|
61
|
+
const delay = computeDelay(attempt, options);
|
|
62
|
+
await sleep(delay, signal);
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
// All retries exhausted — throw the last error
|
|
66
|
+
throw error;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
// This should be unreachable, but TypeScript needs it
|
|
70
|
+
throw lastError;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check whether an HTTP status code is retryable (transient failure).
|
|
74
|
+
*
|
|
75
|
+
* Retryable statuses: 429 (Too Many Requests), 500 (Internal Server Error),
|
|
76
|
+
* 502 (Bad Gateway), 503 (Service Unavailable), 504 (Gateway Timeout).
|
|
77
|
+
*/
|
|
78
|
+
export function isRetryableStatus(status) {
|
|
79
|
+
return RETRYABLE_STATUS_CODES.has(status);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Compute the delay before the next retry attempt.
|
|
83
|
+
*
|
|
84
|
+
* Uses exponential backoff: baseDelay * 2^attempt, capped at maxDelay.
|
|
85
|
+
* Applies randomized jitter (0.5x to 1.5x) when enabled.
|
|
86
|
+
*/
|
|
87
|
+
function computeDelay(attempt, options) {
|
|
88
|
+
const exponentialDelay = options.baseDelayMs * 2 ** attempt;
|
|
89
|
+
const cappedDelay = Math.min(exponentialDelay, options.maxDelayMs);
|
|
90
|
+
if (!options.jitter) {
|
|
91
|
+
return cappedDelay;
|
|
92
|
+
}
|
|
93
|
+
// Apply jitter: multiply by a random factor between 0.5 and 1.5
|
|
94
|
+
const jitterFactor = 0.5 + Math.random();
|
|
95
|
+
return Math.min(jitterFactor * cappedDelay, options.maxDelayMs);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Parse the Retry-After header value from a response.
|
|
99
|
+
*
|
|
100
|
+
* Supports integer seconds format. Returns the delay in milliseconds,
|
|
101
|
+
* or null if the header is missing or unparseable.
|
|
102
|
+
*/
|
|
103
|
+
function parseRetryAfter(response) {
|
|
104
|
+
const retryAfter = response.headers.get('Retry-After');
|
|
105
|
+
if (!retryAfter) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const seconds = Number(retryAfter);
|
|
109
|
+
if (Number.isFinite(seconds) && seconds > 0) {
|
|
110
|
+
return seconds * 1_000;
|
|
111
|
+
}
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Sleep for the specified duration, respecting an optional abort signal.
|
|
116
|
+
*
|
|
117
|
+
* Resolves after the delay or rejects immediately if the signal is already
|
|
118
|
+
* aborted or becomes aborted during the wait.
|
|
119
|
+
*/
|
|
120
|
+
function sleep(ms, signal) {
|
|
121
|
+
return new Promise((resolve, reject) => {
|
|
122
|
+
if (signal?.aborted) {
|
|
123
|
+
reject(signal.reason ?? new DOMException('The operation was aborted.', 'AbortError'));
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const timer = setTimeout(() => {
|
|
127
|
+
signal?.removeEventListener('abort', onAbort);
|
|
128
|
+
resolve();
|
|
129
|
+
}, ms);
|
|
130
|
+
function onAbort() {
|
|
131
|
+
clearTimeout(timer);
|
|
132
|
+
reject(signal?.reason ?? new DOMException('The operation was aborted.', 'AbortError'));
|
|
133
|
+
}
|
|
134
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
//# sourceMappingURL=fetch-retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch-retry.js","sourceRoot":"","sources":["../../src/lib/fetch-retry.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAcH,MAAM,eAAe,GAA2B;IAC9C,WAAW,EAAE,KAAK;IAClB,MAAM,EAAE,IAAI;IACZ,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,CAAC;CACd,CAAC;AAEF,qEAAqE;AACrE,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAA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AC,OAAO,CAAC,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAC5C,OAAO,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,SAAS,KAAK,CAAC,EAAU,EAAE,MAA2B;IACpD,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QAC3C,IAAI,MAAM,EAAE,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,YAAY,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAAC,CAAC;YACtF,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE;YAC5B,MAAM,EAAE,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YAC9C,OAAO,EAAE,CAAC;QACZ,CAAC,EAAE,EAAE,CAAC,CAAC;QAEP,SAAS,OAAO;YACd,YAAY,CAAC,KAAK,CAAC,CAAC;YACpB,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,IAAI,YAAY,CAAC,4BAA4B,EAAE,YAAY,CAAC,CAAC,CAAC;QACzF,CAAC;QAED,MAAM,EAAE,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const DEFAULT_REGISTRY_REPO = "EmergentSoftware/agentic-toolkit";
|
|
2
|
+
export declare const DEFAULT_REGISTRY_BRANCH = "main";
|
|
3
|
+
export declare const DEFAULT_REGISTRY_BRANCH_DEV = "develop";
|
|
4
|
+
/**
|
|
5
|
+
* Determine the effective registry branch based on explicit override or pre-release detection.
|
|
6
|
+
* Pre-release builds (e.g., 0.4.0-dev.5) default to the develop branch.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getEffectiveBranch(registryBranch?: string): string;
|
|
9
|
+
/** GitHub API version used for all API requests. */
|
|
10
|
+
export declare const GITHUB_API_VERSION = "2022-11-28";
|
|
11
|
+
/** Accept header value for standard JSON responses from GitHub API. */
|
|
12
|
+
export declare const GITHUB_ACCEPT_JSON = "application/vnd.github+json";
|
|
13
|
+
/** Accept header value for raw file content responses from GitHub API. */
|
|
14
|
+
export declare const GITHUB_ACCEPT_RAW = "application/vnd.github.raw+json";
|
|
15
|
+
/** A file entry returned from listing an asset directory on GitHub. */
|
|
16
|
+
export interface GitHubFileEntry {
|
|
17
|
+
name: string;
|
|
18
|
+
path: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build a GitHub Contents API URL for a file or directory in the registry repo.
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildGitHubContentsUrl(path: string, branch?: string): string;
|
|
24
|
+
/**
|
|
25
|
+
* Build standard GitHub API request headers.
|
|
26
|
+
*
|
|
27
|
+
* @param token - GitHub authentication token (Bearer)
|
|
28
|
+
* @param accept - Accept header value; defaults to GITHUB_ACCEPT_JSON
|
|
29
|
+
* @returns HeadersInit with Accept, Authorization, and X-GitHub-Api-Version
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildGitHubHeaders(token: string, accept?: string): HeadersInit;
|
|
32
|
+
/**
|
|
33
|
+
* Fetch raw file content from the GitHub Contents API.
|
|
34
|
+
*
|
|
35
|
+
* @param token - GitHub authentication token
|
|
36
|
+
* @param path - Repository-relative file path (e.g. "assets/skills/my-skill/1.0.0/skill.md")
|
|
37
|
+
* @param branch - Optional branch override; defaults to the registry default branch
|
|
38
|
+
*/
|
|
39
|
+
export declare function fetchFileContent(token: string, path: string, branch?: string): Promise<string>;
|
|
40
|
+
/**
|
|
41
|
+
* Return a user-friendly error message for common GitHub API HTTP status codes.
|
|
42
|
+
*/
|
|
43
|
+
export declare function httpErrorMessage(status: number, resource: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* List installable files in an asset's versioned directory on GitHub.
|
|
46
|
+
* Filters out directories, `manifest.json`, and `README.md`.
|
|
47
|
+
*
|
|
48
|
+
* @param token - GitHub authentication token
|
|
49
|
+
* @param asset - Object with `name` and `type` identifying the asset
|
|
50
|
+
* @param version - Semver version string
|
|
51
|
+
* @param branch - Optional branch override
|
|
52
|
+
*/
|
|
53
|
+
export declare function listAssetDirectoryFiles(token: string, asset: {
|
|
54
|
+
name: string;
|
|
55
|
+
type: string;
|
|
56
|
+
}, version: string, branch?: string): Promise<GitHubFileEntry[]>;
|
|
57
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/lib/github.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,qBAAqB,qCAAqC,CAAC;AACxE,eAAO,MAAM,uBAAuB,SAAS,CAAC;AAC9C,eAAO,MAAM,2BAA2B,YAAY,CAAC;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,oDAAoD;AACpD,eAAO,MAAM,kBAAkB,eAAe,CAAC;AAE/C,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,gCAAgC,CAAC;AAEhE,0EAA0E;AAC1E,eAAO,MAAM,iBAAiB,oCAAoC,CAAC;AAEnE,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,WAAW,CAM9E;AAED;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,E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