@cortexkit/aft-bridge 0.59.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bash-format.d.ts +5 -0
- package/dist/bash-format.d.ts.map +1 -1
- package/dist/bash-format.js +12 -5
- package/dist/bash-format.js.map +1 -1
- package/dist/bash-hints.d.ts +3 -3
- package/dist/bash-hints.d.ts.map +1 -1
- package/dist/bash-hints.js +14 -13
- package/dist/bash-hints.js.map +1 -1
- package/dist/bash-host-fallback.d.ts +2 -2
- package/dist/bash-host-fallback.d.ts.map +1 -1
- package/dist/bash-host-fallback.js +2 -2
- package/dist/bash-host-fallback.js.map +1 -1
- package/dist/bridge.d.ts +87 -9
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +289 -108
- package/dist/bridge.js.map +1 -1
- package/dist/config-watch.d.ts +8 -6
- package/dist/config-watch.d.ts.map +1 -1
- package/dist/config-watch.js +17 -12
- package/dist/config-watch.js.map +1 -1
- package/dist/downloader.js +4 -3
- package/dist/downloader.js.map +1 -1
- package/dist/error-contract.d.ts +30 -2
- package/dist/error-contract.d.ts.map +1 -1
- package/dist/error-contract.js +69 -7
- package/dist/error-contract.js.map +1 -1
- package/dist/feature-config.d.ts +3 -0
- package/dist/feature-config.d.ts.map +1 -1
- package/dist/feature-config.js +124 -0
- package/dist/feature-config.js.map +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -6
- package/dist/index.js.map +1 -1
- package/dist/lsp-github-install.d.ts +104 -0
- package/dist/lsp-github-install.d.ts.map +1 -0
- package/dist/lsp-github-install.js +1455 -0
- package/dist/lsp-github-install.js.map +1 -0
- package/dist/lsp-github-probe.d.ts +81 -0
- package/dist/lsp-github-probe.d.ts.map +1 -0
- package/dist/lsp-github-probe.js +131 -0
- package/dist/lsp-github-probe.js.map +1 -0
- package/dist/lsp-github-table.d.ts +64 -0
- package/dist/lsp-github-table.d.ts.map +1 -0
- package/dist/lsp-github-table.js +174 -0
- package/dist/lsp-github-table.js.map +1 -0
- package/dist/migration.d.ts +10 -3
- package/dist/migration.d.ts.map +1 -1
- package/dist/migration.js +19 -14
- package/dist/migration.js.map +1 -1
- package/dist/onnx-runtime.d.ts +2 -0
- package/dist/onnx-runtime.d.ts.map +1 -1
- package/dist/onnx-runtime.js +12 -7
- package/dist/onnx-runtime.js.map +1 -1
- package/dist/paths.d.ts +3 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +41 -6
- package/dist/paths.js.map +1 -1
- package/dist/pool.d.ts +8 -0
- package/dist/pool.d.ts.map +1 -1
- package/dist/pool.js +31 -8
- package/dist/pool.js.map +1 -1
- package/dist/project-identity.d.ts +2 -0
- package/dist/project-identity.d.ts.map +1 -1
- package/dist/project-identity.js +8 -2
- package/dist/project-identity.js.map +1 -1
- package/dist/protocol.d.ts +3 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -1
- package/dist/protocol.js.map +1 -1
- package/dist/resolver.d.ts.map +1 -1
- package/dist/resolver.js +5 -2
- package/dist/resolver.js.map +1 -1
- package/dist/revivable-transport.d.ts +16 -1
- package/dist/revivable-transport.d.ts.map +1 -1
- package/dist/revivable-transport.js +83 -11
- package/dist/revivable-transport.js.map +1 -1
- package/dist/subc-transport.d.ts +45 -4
- package/dist/subc-transport.d.ts.map +1 -1
- package/dist/subc-transport.js +659 -49
- package/dist/subc-transport.js.map +1 -1
- package/dist/tar-executable.d.ts +3 -1
- package/dist/tar-executable.d.ts.map +1 -1
- package/dist/tar-executable.js +35 -15
- package/dist/tar-executable.js.map +1 -1
- package/dist/transport-factory.d.ts.map +1 -1
- package/dist/transport-factory.js +8 -32
- package/dist/transport-factory.js.map +1 -1
- package/dist/transport.d.ts +27 -0
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +9 -0
- package/dist/transport.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9,11 +9,10 @@
|
|
|
9
9
|
// --- logger contract ---
|
|
10
10
|
export { setActiveLogger } from "./active-logger.js";
|
|
11
11
|
// --- bash output hints (shared by both plugin hosts) ---
|
|
12
|
-
export { formatForegroundResult, formatSeconds, isTerminalStatus, monotonicNowMs, sleep, } from "./bash-format.js";
|
|
12
|
+
export { formatForegroundResult, formatSeconds, isLiveBackgroundTaskReply, isTerminalStatus, monotonicNowMs, sleep, TERMINAL_BG_TASK_STATUSES, } from "./bash-format.js";
|
|
13
13
|
export { abortableSleep, commandInvokesCodeSearch, DEFAULT_PRIMARY_WATCH_TIMEOUT_MS, DEFAULT_WORKER_WAIT_MAX_MS, formatWaitDuration, formatWatchWaited, interruptedWatchTail, LONGEST_TIMER_DELAY_MS, MAX_WATCH_TIMEOUT_MS, MIN_WORKER_WAIT_MAX_MS, maxWatchTimeoutMs, maybeAppendConflictsHint, maybeAppendGrepSearchHint, outputTail, resolveWatchTimeoutMs, runningTaskStatusHint, taskKillDeadlineText, taskKillDeadlineWithinHandoffMargin, WATCH_SYNC_DEFAULTS_DESCRIPTION, WATCH_TIMEOUT_PARAM_DESCRIPTION, WATCH_UNAVAILABLE_GIVE_UP_MS, WORKER_KEEP_WAITING, WORKER_WAIT_LIMIT_PHRASE, watchClock, watchPollDelayMs, watchTimeoutSteer, watchUnavailableSteer, workerBackgroundTaskNote, workerWatchStillRunning, } from "./bash-hints.js";
|
|
14
14
|
export { BASH_HOST_FALLBACK_BANNER, BASH_HOST_FALLBACK_MAX_OUTPUT_BYTES, BASH_HOST_FALLBACK_MAX_TIMEOUT_MS, BASH_HOST_FALLBACK_REFUSAL, BASH_RUNON_DESCRIPTION, BASH_RUNON_GUIDANCE, bashHostFallbackAskPattern, runBashHostFallback, } from "./bash-host-fallback.js";
|
|
15
15
|
export { __fileDigestWorkForTests, cachedFileSha256, cachedFileSha256Sync, checkBinaryIdentity, identitySidecarPath, isTrustedCachedBinary, readBinaryIdentity, writeStampedFileDigest, } from "./binary-identity.js";
|
|
16
|
-
// --- transport ---
|
|
17
16
|
export { BinaryBridge, BridgeTransportTimeoutError, BridgeTransportUnavailableError, BridgeTransportUnknownOutcomeError, compareSemver, isBridgeTransportTimeout, tagStderrLine, } from "./bridge.js";
|
|
18
17
|
// --- cache paths and binary resolution ---
|
|
19
18
|
export { getAftBinaryCacheDir, getAftCacheRoot, getAftLspBinariesDir, getAftLspPackagesDir, getOpenCodeCacheRoot, getOpenCodeConfigRoot, } from "./cache-paths.js";
|
|
@@ -32,14 +31,19 @@ export { downloadBinary, ensureBinary, getBinaryName, getCacheDir, getCachedBina
|
|
|
32
31
|
export { DEFAULT_LOG_BYTES, DEFAULT_LOG_GENERATIONS, RotatingLogSink, } from "./durable-log.js";
|
|
33
32
|
export { formatEditSummary } from "./edit-summary.js";
|
|
34
33
|
// --- host-neutral agent tool errors ---
|
|
35
|
-
export { AftToolError, adaptToolError, BASH_TRANSPORT_DISPOSITION, BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION, classifyBashHostFallbackError, isBashTransportDeadError, SUBC_ROUTE_CLOSED_MID_CALL_DISPOSITION, toolErrorFromResponse, } from "./error-contract.js";
|
|
34
|
+
export { AftToolError, adaptToolError, BASH_FRAME_READ_TIMEOUT_DISPOSITION, BASH_TRANSPORT_DISPOSITION, BRIDGE_TRANSPORT_UNKNOWN_OUTCOME_DISPOSITION, classifyBashHostFallbackError, isBashTransportDeadError, SHELL_TIMEOUT_UNKNOWN_DISPOSITION, SUBC_FRAME_READ_TIMEOUT_DISPOSITION, SUBC_ROUTE_CLOSED_MID_CALL_DISPOSITION, shellTimeoutNotStartedDisposition, shellTimeoutTaskDisposition, toolErrorFromResponse, } from "./error-contract.js";
|
|
36
35
|
// --- feature-based configuration policy (shared with crates/aft feature_config.rs) ---
|
|
37
36
|
export * from "./feature-config.js";
|
|
38
37
|
// --- compact UI formatting ---
|
|
39
38
|
export { compressionSavingsPercent, formatTokenCount } from "./format.js";
|
|
40
39
|
// --- jsonc helpers ---
|
|
41
40
|
export { stripJsoncSymbols } from "./jsonc.js";
|
|
41
|
+
// --- transport ---
|
|
42
|
+
export { asCanonicalRootPath } from "./lifecycle-registry.js";
|
|
42
43
|
export { acquireBridge, getBridgeLifecycleTopology, releaseBridge, sampleBridgeLifecycleCensus, } from "./location-lifecycle.js";
|
|
44
|
+
export { createGithubInstaller, } from "./lsp-github-install.js";
|
|
45
|
+
export { assertSafeVersion, isSafeVersion, pickEligibleRelease, probeGithubReleases, stripTagV, } from "./lsp-github-probe.js";
|
|
46
|
+
export { detectHostPlatform, findGithubServerById, GITHUB_LSP_TABLE, } from "./lsp-github-table.js";
|
|
43
47
|
// --- which incoming messages interrupt a blocking bash wait ---
|
|
44
48
|
export { BASH_WAIT_DETACH_MAGIC_KEYWORD, containsStandaloneDetachKeyword, detachStripEdits, shouldInterruptWaitsForMessage, standaloneDetachKeywordRanges, stripDetachKeywordsAndTidyGap, stripStandaloneDetachKeywords, } from "./message-detach.js";
|
|
45
49
|
// --- storage migration ---
|
|
@@ -53,7 +57,7 @@ export { InvalidRequestError, isWellFormedUnicodeString, prepareCanonicalEditArg
|
|
|
53
57
|
export { relativePathEscapesRoot, shortenHomePath } from "./path-display.js";
|
|
54
58
|
export { withPathPrepended } from "./path-env.js";
|
|
55
59
|
export { findExecutableOnPath, findExecutablesOnPath, } from "./path-lookup.js";
|
|
56
|
-
export { decodeFileUrl, markAnnouncementSeen, repairRootScopedStorageFile, resolveCortexKitConfigPaths, resolveCortexKitProjectConfigPath, resolveCortexKitUserConfigPath, resolveHarnessStoragePath, resolveLegacyAftConfigSources, shouldShowAnnouncement, } from "./paths.js";
|
|
60
|
+
export { decodeFileUrl, legacyProjectConfigLocationNotice, markAnnouncementSeen, repairRootScopedStorageFile, resolveCortexKitConfigPaths, resolveCortexKitProjectConfigPath, resolveCortexKitUserConfigPath, resolveHarnessStoragePath, resolveLegacyAftConfigSources, resolveProjectConfigReadPath, shouldShowAnnouncement, } from "./paths.js";
|
|
57
61
|
// --- platform helpers ---
|
|
58
62
|
export { PLATFORM_ARCH_MAP, PLATFORM_ASSET_MAP } from "./platform.js";
|
|
59
63
|
export { BridgePool, HomeProjectRootError, isHomeDirectoryRoot } from "./pool.js";
|
|
@@ -63,10 +67,10 @@ export { findBinary, findBinarySync, isNativeExecutable, platformKey } from "./r
|
|
|
63
67
|
export { RevivableTransportPool } from "./revivable-transport.js";
|
|
64
68
|
export { formatSemanticIndexStatus, semanticIndexStatusKind } from "./semantic-status.js";
|
|
65
69
|
export { isTestEnvironment, resolveAftLogPath, resolveAftStorageRoot, resolveDataHome, resolvePluginLogPath, resolveStoragePath, } from "./storage-paths.js";
|
|
66
|
-
export { resolveBridgeForNudge, SubcRouteClosedMidCallError, SubcTransportPool, SubcTransportShuttingDownError, } from "./subc-transport.js";
|
|
70
|
+
export { isSubcFrameReadTimeoutError, resolveBridgeForNudge, SubcFrameReadTimeoutError, SubcRouteClosedMidCallError, SubcTransportPool, SubcTransportShuttingDownError, } from "./subc-transport.js";
|
|
67
71
|
export { execTarExtractionSync, windowsTarExecutable } from "./tar-executable.js";
|
|
68
72
|
export { formatBridgeErrorMessage, formatReadFooter } from "./tool-format.js";
|
|
69
|
-
export { callPresetFor, observeFreshSessionStart, PRESET_FIELD, WORKER_SESSION_FIELD, } from "./transport.js";
|
|
73
|
+
export { callPresetFor, HOST_TOOL_NAMES_FIELD, observeFreshSessionStart, PRESET_FIELD, WORKER_SESSION_FIELD, } from "./transport.js";
|
|
70
74
|
export { createAftTransportPool, subcConnectionFileError, } from "./transport-factory.js";
|
|
71
75
|
export { readBinaryVersionOffThread } from "./version-probe.js";
|
|
72
76
|
export { formatZoomMultiTargetResult, formatZoomText, isRustZoomBatchEnvelope, unwrapRustZoomBatchEnvelope, } from "./zoom-format.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0BAA0B;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,0DAA0D;AAC1D,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,KAAK,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,0BAA0B;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,0DAA0D;AAC1D,OAAO,EACL,sBAAsB,EACtB,aAAa,EACb,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,KAAK,EACL,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,gCAAgC,EAChC,0BAA0B,EAC1B,kBAAkB,EAClB,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,UAAU,EACV,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,mCAAmC,EACnC,+BAA+B,EAC/B,+BAA+B,EAC/B,4BAA4B,EAE5B,mBAAmB,EACnB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,yBAAyB,EACzB,mCAAmC,EACnC,iCAAiC,EACjC,0BAA0B,EAC1B,sBAAsB,EACtB,mBAAmB,EAGnB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,wBAAwB,EACxB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAY9B,OAAO,EACL,Y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EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAGlE,OAAO,EAAE,yBAAyB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,kBAAkB,GAInB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EAEzB,2BAA2B,EAC3B,iBAAiB,EAEjB,8BAA8B,GAC/B,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAGlF,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAW9E,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,wBAAwB,EACxB,YAAY,EACZ,oBAAoB,GACrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAEL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAShE,OAAO,EACL,2BAA2B,EAC3B,cAAc,EACd,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GitHub-release auto-installer for LSP servers (Pattern C).
|
|
3
|
+
*
|
|
4
|
+
* Cache layout under `<aft-cache-root>/lsp-binaries/`:
|
|
5
|
+
*
|
|
6
|
+
* <id>/
|
|
7
|
+
* bin/<binary> ← standalone binary only
|
|
8
|
+
* extracted/ ← intact distribution and runtime resources
|
|
9
|
+
* .aft-version-check ← JSON: { last_checked, latest_eligible }
|
|
10
|
+
* .aft-installing ← lockfile while a download/extract runs
|
|
11
|
+
*
|
|
12
|
+
* `lsp_paths_extra` receives the executable's real directory: `bin/` for
|
|
13
|
+
* standalone servers, or the in-tree binary directory for distributions.
|
|
14
|
+
*
|
|
15
|
+
* Extraction containment:
|
|
16
|
+
* 1. Download to `<id>/<asset-name>` with a hard size cap.
|
|
17
|
+
* 2. Extract into a staging dir `<id>/extracted.staging-<rand>/`.
|
|
18
|
+
* 3. Walk the staging tree and reject any entry that is a symlink, hardlink,
|
|
19
|
+
* or whose canonical path escapes the staging root.
|
|
20
|
+
* 4. Check the staged executable and runtime, then rename the old extraction
|
|
21
|
+
* aside and swap the staged tree in, restoring the old tree if the swap fails.
|
|
22
|
+
* 5. Stage dir is always cleaned up — success or failure.
|
|
23
|
+
*
|
|
24
|
+
* GitHub pin resolution:
|
|
25
|
+
* When `lsp.versions: { "owner/repo": "X" }` is set, we use GitHub's
|
|
26
|
+
* `/releases/tags/<tag>` endpoint directly (with `v`-prefix tolerance)
|
|
27
|
+
* instead of relying on the broader `/releases?per_page=30` probe. The
|
|
28
|
+
* probe is for "what is the latest eligible version" — not "is this
|
|
29
|
+
* specific pinned tag valid".
|
|
30
|
+
*/
|
|
31
|
+
import { type GithubServerSpec, type Platform } from "./lsp-github-table.js";
|
|
32
|
+
export interface GithubInstallConfig {
|
|
33
|
+
autoInstall: boolean;
|
|
34
|
+
graceDays: number;
|
|
35
|
+
/** Per-package version pin map; key is `owner/repo`. Bypasses grace. */
|
|
36
|
+
versions: Readonly<Record<string, string>>;
|
|
37
|
+
disabled: ReadonlySet<string>;
|
|
38
|
+
}
|
|
39
|
+
export interface GithubAutoInstallResult {
|
|
40
|
+
/** Verified caches are available immediately; newly validated directories arrive in the background. */
|
|
41
|
+
cachedBinDirs: string[];
|
|
42
|
+
installsStarted: number;
|
|
43
|
+
/** Binary names whose installs are actively in flight at return time. */
|
|
44
|
+
installingBinaries: string[];
|
|
45
|
+
skipped: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
reason: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Promise that resolves when cached validation and backgrounded installs settle.
|
|
51
|
+
* Each install holds its per-package install lock for its full duration.
|
|
52
|
+
* Hosts continue startup immediately and await this in their background path refresh.
|
|
53
|
+
*/
|
|
54
|
+
installsComplete: Promise<void>;
|
|
55
|
+
/** Re-scan the cache after background installs settle. */
|
|
56
|
+
getCachedBinDirs: () => Promise<string[]>;
|
|
57
|
+
}
|
|
58
|
+
export interface GithubAutoInstallOptions {
|
|
59
|
+
/** Refresh host configuration when one server's cached path becomes ready. */
|
|
60
|
+
onCachedBinDirsChanged?: (directory?: string) => void;
|
|
61
|
+
/** Shorter lock waits let shared tests cover timeout behavior without waiting minutes. */
|
|
62
|
+
__lockWaitTimeoutMsForTests?: number;
|
|
63
|
+
__lockPollIntervalMsForTests?: number;
|
|
64
|
+
}
|
|
65
|
+
export interface GithubInstallerHost {
|
|
66
|
+
log(message: string): void;
|
|
67
|
+
warn(message: string): void;
|
|
68
|
+
error(message: string): void;
|
|
69
|
+
readVersionCheck(repo: string): {
|
|
70
|
+
last_checked: string;
|
|
71
|
+
latest_eligible: string | null;
|
|
72
|
+
} | null;
|
|
73
|
+
writeVersionCheck(repo: string, latest: string | null): void;
|
|
74
|
+
shouldRecheckVersion(record: {
|
|
75
|
+
last_checked: string;
|
|
76
|
+
latest_eligible: string | null;
|
|
77
|
+
} | null, intervalMs: number): boolean;
|
|
78
|
+
withInstallLock<T>(repo: string, action: () => Promise<T>): Promise<T | null>;
|
|
79
|
+
/** Non-blocking acquisition of the same lease used by withInstallLock. */
|
|
80
|
+
acquireInstallLock(repo: string): {
|
|
81
|
+
release(): void;
|
|
82
|
+
} | null;
|
|
83
|
+
hasRootMarker(root: string, markers: readonly string[] | undefined): boolean;
|
|
84
|
+
relevantExtensionsInProject(root: string, extensions: Readonly<Record<string, unknown>>): Set<string>;
|
|
85
|
+
/** OpenCode suppresses missing-binary notices while its background installs settle. */
|
|
86
|
+
reportInstallingBinaries: boolean;
|
|
87
|
+
}
|
|
88
|
+
/** Bind host logging, shared-cache leases and project scanning without forking installation policy. */
|
|
89
|
+
export declare function createGithubInstaller(services: GithubInstallerHost): {
|
|
90
|
+
ghBinaryPath: (spec: GithubServerSpec, platform: Platform) => string;
|
|
91
|
+
isGithubInstalled: (spec: GithubServerSpec, platform: Platform) => boolean;
|
|
92
|
+
__githubBinaryHashCountForTests: () => number;
|
|
93
|
+
validateExtraction: (stagingRoot: string) => void;
|
|
94
|
+
precheckArchiveContents: (archivePath: string, archiveType: string, zipListingMode?: "platform" | "tar") => Promise<void>;
|
|
95
|
+
abortInFlightGithubInstalls: () => Promise<void>;
|
|
96
|
+
runGithubAutoInstall: (relevantServers: ReadonlySet<string>, config: GithubInstallConfig, fetchImpl?: typeof fetch, options?: GithubAutoInstallOptions) => GithubAutoInstallResult;
|
|
97
|
+
discoverRelevantGithubServers: (projectRoot: string) => Set<string>;
|
|
98
|
+
_assertAllowedDownloadUrlForTesting: (rawUrl: string) => URL;
|
|
99
|
+
_downloadFileForTesting: (url: string, destPath: string, fetchImpl: typeof fetch, assetSize?: number, signal?: AbortSignal) => Promise<void>;
|
|
100
|
+
_extractArchiveSafelyForTesting: (archivePath: string, destDir: string, archiveType: string, validateStaged?: (stagingDir: string) => Promise<void>) => Promise<void>;
|
|
101
|
+
_precheckArchiveSizeForTesting: (archivePath: string, archiveType: string, zipListingMode?: "platform" | "tar") => Promise<void>;
|
|
102
|
+
_runArchiveToolForTesting: (command: string, args: string[], timeout: number) => Promise<string>;
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=lsp-github-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-github-install.d.ts","sourceRoot":"","sources":["../src/lsp-github-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAmCH,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAA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