@cortexkit/aft-pi 0.16.1 → 0.17.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/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1609 -140
- package/dist/lsp-auto-install.d.ts +82 -0
- package/dist/lsp-auto-install.d.ts.map +1 -0
- package/dist/lsp-cache.d.ts +96 -0
- package/dist/lsp-cache.d.ts.map +1 -0
- package/dist/lsp-github-install.d.ts +90 -0
- package/dist/lsp-github-install.d.ts.map +1 -0
- package/dist/lsp-github-probe.d.ts +66 -0
- package/dist/lsp-github-probe.d.ts.map +1 -0
- package/dist/lsp-github-table.d.ts +62 -0
- package/dist/lsp-github-table.d.ts.map +1 -0
- package/dist/lsp-npm-table.d.ts +31 -0
- package/dist/lsp-npm-table.d.ts.map +1 -0
- package/dist/lsp-project-relevance.d.ts +11 -0
- package/dist/lsp-project-relevance.d.ts.map +1 -0
- package/dist/lsp-registry-probe.d.ts +50 -0
- package/dist/lsp-registry-probe.d.ts.map +1 -0
- package/dist/onnx-runtime.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Orchestrates AFT's npm-based LSP auto-install.
|
|
3
|
+
*
|
|
4
|
+
* Flow at plugin startup:
|
|
5
|
+
*
|
|
6
|
+
* 1. Resolve already-cached LSP binary directories. Pass these to Rust as
|
|
7
|
+
* `lsp_paths_extra` so the layered resolver finds them before PATH.
|
|
8
|
+
*
|
|
9
|
+
* 2. For each Pattern B/D server whose project is "relevant" (root marker
|
|
10
|
+
* OR matching extension exists in the bounded project walk) AND not yet cached
|
|
11
|
+
* AND not in `lsp.disabled`:
|
|
12
|
+
*
|
|
13
|
+
* a. If a user pinned a version via `lsp.versions: {"<pkg>": "X"}`,
|
|
14
|
+
* use that version directly (skip 7-day grace).
|
|
15
|
+
* b. Else if cache says we checked recently (< grace_days ago) and
|
|
16
|
+
* we have a known eligible version, use it.
|
|
17
|
+
* c. Else probe the npm registry, apply 7-day grace filter.
|
|
18
|
+
* d. If grace blocks all candidates AND the package is already
|
|
19
|
+
* installed, log a warning and keep the existing version.
|
|
20
|
+
* Otherwise skip + warn.
|
|
21
|
+
*
|
|
22
|
+
* 3. Spawn `bun add <pkg>@<version> --cwd <cache_dir> --ignore-scripts`
|
|
23
|
+
* in the background. Drop a lockfile while running. Log progress.
|
|
24
|
+
*
|
|
25
|
+
* 4. The newly-installed binary will be picked up on the user's NEXT
|
|
26
|
+
* plugin session — first session with auto-install just kicks off
|
|
27
|
+
* the install. This matches OpenCode's "may need restart" UX and
|
|
28
|
+
* avoids mid-session bridge restarts.
|
|
29
|
+
*/
|
|
30
|
+
/** Per-call configuration drawn from `lsp.*` plugin config. */
|
|
31
|
+
export interface AutoInstallConfig {
|
|
32
|
+
/** Master enable. Default: true. */
|
|
33
|
+
autoInstall: boolean;
|
|
34
|
+
/** Supply-chain grace window. Default: 7. */
|
|
35
|
+
graceDays: number;
|
|
36
|
+
/** User-pinned versions (bypasses grace). E.g. `{ "pyright": "1.1.300" }`. */
|
|
37
|
+
versions: Readonly<Record<string, string>>;
|
|
38
|
+
/** Server IDs the user explicitly disabled. Lowercase string match against `NpmServerSpec.id`. */
|
|
39
|
+
disabled: ReadonlySet<string>;
|
|
40
|
+
}
|
|
41
|
+
/** Result returned to the caller. */
|
|
42
|
+
export interface AutoInstallResult {
|
|
43
|
+
/** Bin directories of every cached install — pass to Rust as `lsp_paths_extra`. */
|
|
44
|
+
cachedBinDirs: string[];
|
|
45
|
+
/** Number of background installs kicked off. */
|
|
46
|
+
installsStarted: number;
|
|
47
|
+
/**
|
|
48
|
+
* Servers that were disabled or skipped at decision time (synchronous).
|
|
49
|
+
*
|
|
50
|
+
* Note: this only includes synchronous reasons (disabled, irrelevant,
|
|
51
|
+
* `auto_install: false`). Async reasons (grace blocked, registry probe
|
|
52
|
+
* failed, install crashed) populate via the `installsComplete` callback
|
|
53
|
+
* because they're known only after the background work runs.
|
|
54
|
+
*/
|
|
55
|
+
skipped: Array<{
|
|
56
|
+
id: string;
|
|
57
|
+
reason: string;
|
|
58
|
+
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Promise that resolves when EVERY backgrounded install settles. Each
|
|
61
|
+
* install holds its per-package install lock for the entire duration;
|
|
62
|
+
* concurrent sessions racing into the same package will see the lock
|
|
63
|
+
* held and back off honestly.
|
|
64
|
+
*
|
|
65
|
+
* Plugin startup ignores this; tests await it to assert install outcomes.
|
|
66
|
+
* Each completed install pushes its skip-reason into `skipped` (mutates
|
|
67
|
+
* the array shared with the synchronous return value).
|
|
68
|
+
*/
|
|
69
|
+
installsComplete: Promise<void>;
|
|
70
|
+
}
|
|
71
|
+
export declare function abortInFlightAutoInstalls(): Promise<void>;
|
|
72
|
+
/**
|
|
73
|
+
* Top-level entry point. Returns the list of bin directories that already
|
|
74
|
+
* have an installed binary AND kicks off background installs for missing
|
|
75
|
+
* packages relevant to this project.
|
|
76
|
+
*
|
|
77
|
+
* Caller passes `cachedBinDirs` to Rust as `lsp_paths_extra`. The result
|
|
78
|
+
* is correct on first launch even though some installs may still be
|
|
79
|
+
* running — those binaries appear in the cache on the NEXT session.
|
|
80
|
+
*/
|
|
81
|
+
export declare function runAutoInstall(projectRoot: string, config: AutoInstallConfig, fetchImpl?: typeof fetch): AutoInstallResult;
|
|
82
|
+
//# sourceMappingURL=lsp-auto-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-auto-install.d.ts","sourceRoot":"","sources":["../src/lsp-auto-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAsBH,+DAA+D;AAC/D,MAAM,WAAW,iBAAiB;IAChC,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,SAAS,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,kGAAkG;IAClG,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAED,qCAAqC;AACrC,MAAM,WAAW,iBAAiB;IAChC,mFAAmF;IACnF,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,gDAAgD;IAChD,eAAe,EAAE,MAAM,CAAC;IACxB;;;;;;;OAOG;IACH,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;;;;;;OASG;IACH,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAkDD,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAM/D;AAiSD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAC5B,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,OAAO,KAAa,GAC9B,iBAAiB,CAqEnB"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Disk layout and bookkeeping for AFT's auto-installed LSP cache.
|
|
3
|
+
*
|
|
4
|
+
* Layout under `<aft-cache-root>/lsp-packages/`:
|
|
5
|
+
*
|
|
6
|
+
* <pkg>/
|
|
7
|
+
* node_modules/.bin/<binary> ← actual installed binary
|
|
8
|
+
* node_modules/<pkg>/...
|
|
9
|
+
* package.json ← created by `bun add`
|
|
10
|
+
* .aft-version-check ← JSON: { last_checked: ISO, latest: "X.Y.Z" }
|
|
11
|
+
* .aft-installing ← presence = install in progress (lockfile)
|
|
12
|
+
*
|
|
13
|
+
* For scoped packages like `@vue/language-server`, the `@` is preserved in
|
|
14
|
+
* the directory path. `<pkg>` is URL-encoded to keep filesystem-safe paths
|
|
15
|
+
* for any future packages with unusual characters.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Root directory that holds all AFT-installed LSP packages.
|
|
19
|
+
*
|
|
20
|
+
* Honors `AFT_CACHE_DIR` for tests so suites do not pollute the real
|
|
21
|
+
* user cache. Falls back to the platform cache root used by the CLI:
|
|
22
|
+
* `%LOCALAPPDATA%/aft` on Windows, `$XDG_CACHE_HOME/aft` or `~/.cache/aft`
|
|
23
|
+
* elsewhere.
|
|
24
|
+
*/
|
|
25
|
+
export declare function aftCacheBase(): string;
|
|
26
|
+
export declare function lspCacheRoot(): string;
|
|
27
|
+
/** Directory for one specific npm package's install. */
|
|
28
|
+
export declare function lspPackageDir(npmPackage: string): string;
|
|
29
|
+
/** Path to the binary inside that package's `node_modules/.bin/`. */
|
|
30
|
+
export declare function lspBinaryPath(npmPackage: string, binary: string): string;
|
|
31
|
+
/** Directory passed to Rust as part of `lsp_paths_extra`. */
|
|
32
|
+
export declare function lspBinDir(npmPackage: string): string;
|
|
33
|
+
/** True when the cached binary file exists. */
|
|
34
|
+
export declare function isInstalled(npmPackage: string, binary: string): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Per-install metadata recorded after a successful install.
|
|
37
|
+
*
|
|
38
|
+
* Audit v0.17 #4: lets the next session detect a `lsp.versions` pin change.
|
|
39
|
+
* Audit v0.17 #1: optional `sha256` enables TOFU verification on GitHub installs.
|
|
40
|
+
*/
|
|
41
|
+
export interface InstalledMeta {
|
|
42
|
+
version: string;
|
|
43
|
+
installedAt: string;
|
|
44
|
+
sha256?: string;
|
|
45
|
+
}
|
|
46
|
+
/** Write the installed-version record into `installDir`. Best-effort. */
|
|
47
|
+
export declare function writeInstalledMetaIn(installDir: string, version: string, sha256?: string): void;
|
|
48
|
+
/** Read the installed-version record from `installDir`, or null if missing/corrupt. */
|
|
49
|
+
export declare function readInstalledMetaIn(installDir: string): InstalledMeta | null;
|
|
50
|
+
/** npm install path: write installed metadata into the package cache dir.
|
|
51
|
+
*
|
|
52
|
+
* Audit-2 v0.17 #1: pass `sha256` of the installed binary so the next
|
|
53
|
+
* session can do TOFU verification on reinstalls of the same version.
|
|
54
|
+
*/
|
|
55
|
+
export declare function writeInstalledMeta(packageKey: string, version: string, sha256?: string): void;
|
|
56
|
+
/** npm install path: read installed metadata from the package cache dir. */
|
|
57
|
+
export declare function readInstalledMeta(packageKey: string): InstalledMeta | null;
|
|
58
|
+
/**
|
|
59
|
+
* Acquire an install lock for `lockKey` using an atomic `O_EXCL` open.
|
|
60
|
+
*
|
|
61
|
+
* The previous implementation used `existsSync` + `writeFileSync({flag:"w"})`
|
|
62
|
+
* which is a textbook TOCTOU: two concurrent processes both pass the check,
|
|
63
|
+
* both call write (which truncates with flag "w"), and both think they own
|
|
64
|
+
* the lock. With `wx` the second process's open() fails atomically.
|
|
65
|
+
*
|
|
66
|
+
* Stale-lock recovery: if the lock file exists, we read it. If the recorded
|
|
67
|
+
* PID is no longer alive OR the file is older than `STALE_LOCK_MS`, we claim
|
|
68
|
+
* the lock by atomically replacing it (unlink + create with `wx`). If that
|
|
69
|
+
* race fails (someone else just claimed it), we return false honestly.
|
|
70
|
+
*
|
|
71
|
+
* The lock file content is `<pid>\n<iso-timestamp>\n` so other processes
|
|
72
|
+
* can detect dead owners.
|
|
73
|
+
*/
|
|
74
|
+
export declare function acquireInstallLock(lockKey: string): boolean;
|
|
75
|
+
export declare function releaseInstallLock(lockKey: string): void;
|
|
76
|
+
/**
|
|
77
|
+
* Run `task` while holding the install lock. The lock is released only
|
|
78
|
+
* when `task` settles (resolves or rejects), not when it starts.
|
|
79
|
+
*
|
|
80
|
+
* Returns the task's resolved value, or `null` if the lock could not be
|
|
81
|
+
* acquired (caller should treat as "another install in progress").
|
|
82
|
+
*/
|
|
83
|
+
export declare function withInstallLock<T>(lockKey: string, task: () => Promise<T>): Promise<T | null>;
|
|
84
|
+
/** Last-checked metadata stored next to the install. */
|
|
85
|
+
interface VersionCheckRecord {
|
|
86
|
+
/** ISO timestamp of the last `npm registry probe`. */
|
|
87
|
+
last_checked: string;
|
|
88
|
+
/** Version string that was eligible at last check (after grace filter). */
|
|
89
|
+
latest_eligible: string | null;
|
|
90
|
+
}
|
|
91
|
+
export declare function readVersionCheck(npmPackage: string): VersionCheckRecord | null;
|
|
92
|
+
export declare function writeVersionCheck(npmPackage: string, latest: string | null): void;
|
|
93
|
+
/** True if more than `graceDays` × 24h have elapsed since `last_checked`. */
|
|
94
|
+
export declare function shouldRecheckVersion(record: VersionCheckRecord | null, weeklyCheckIntervalMs?: number): boolean;
|
|
95
|
+
export {};
|
|
96
|
+
//# sourceMappingURL=lsp-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-cache.d.ts","sourceRoot":"","sources":["../src/lsp-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAgBH;;;;;;;GAOG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAYrC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED,wDAAwD;AACxD,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAExD;AAED,qEAAqE;AACrE,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExE;AAED,6DAA6D;AAC7D,wBAAgB,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEpD;AAED,+CAA+C;AAC/C,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CASvE;AAOD;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAID,yEAAyE;AACzE,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAY/F;AAED,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAiB5E;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAE7F;AAED,4EAA4E;AAC5E,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CAE1E;AAeD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAiE3D;AAmBD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CASxD;AAED;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACrB,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAOnB;AAED,wDAAwD;AACxD,UAAU,kBAAkB;IAC1B,sDAAsD;IACtD,YAAY,EAAE,MAAM,CAAC;IACrB,2EAA2E;IAC3E,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAChC;AAID,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,IAAI,CAe9E;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAQjF;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,kBAAkB,GAAG,IAAI,EACjC,qBAAqB,SAA0B,GAC9C,OAAO,CAKT"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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> ← extracted binary (or shim)
|
|
8
|
+
* extracted/ ← validated extraction (kept for upgrades)
|
|
9
|
+
* .aft-version-check ← JSON: { last_checked, latest_eligible }
|
|
10
|
+
* .aft-installing ← lockfile while a download/extract runs
|
|
11
|
+
*
|
|
12
|
+
* `bin/<binary>` is what we add to `lsp_paths_extra` so the Rust resolver
|
|
13
|
+
* can find it.
|
|
14
|
+
*
|
|
15
|
+
* Extraction containment (audit #3):
|
|
16
|
+
* 1. Download to `<id>/<asset-name>` with a hard size cap (audit #4).
|
|
17
|
+
* 2. Extract into a quarantine dir `<id>/.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. Only after validation: `renameSync(staging, extracted)` atomically
|
|
21
|
+
* replaces any prior extraction.
|
|
22
|
+
* 5. Stage dir is always cleaned up — success or failure.
|
|
23
|
+
*
|
|
24
|
+
* GitHub pin resolution (audit #5):
|
|
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 Arch, detectHostPlatform, findGithubServerById, GITHUB_LSP_TABLE, type GithubServerSpec, type Platform } from "./lsp-github-table.js";
|
|
32
|
+
/** Final binary path under our cache. */
|
|
33
|
+
export declare function ghBinaryPath(spec: GithubServerSpec, platform: Platform): string;
|
|
34
|
+
export declare function isGithubInstalled(spec: GithubServerSpec, platform: Platform): boolean;
|
|
35
|
+
export interface GithubInstallConfig {
|
|
36
|
+
autoInstall: boolean;
|
|
37
|
+
graceDays: number;
|
|
38
|
+
/** Per-package version pin map; key is `owner/repo`. Bypasses grace. */
|
|
39
|
+
versions: Readonly<Record<string, string>>;
|
|
40
|
+
disabled: ReadonlySet<string>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Recursively validate that every entry under `stagingRoot` is contained
|
|
44
|
+
* within it (audit #3: zip-slip + symlink containment).
|
|
45
|
+
*
|
|
46
|
+
* Rejects:
|
|
47
|
+
* - Any symlink (regardless of where it points). Symlinks in LSP
|
|
48
|
+
* installs are extremely rare and would be a red flag.
|
|
49
|
+
* - Any hardlink that has multiple inodes pointing at the same file
|
|
50
|
+
* OUTSIDE the staging root (we can't easily detect this for hardlinks
|
|
51
|
+
* to other paths inside the same archive, but those aren't a containment
|
|
52
|
+
* escape).
|
|
53
|
+
* - Any entry whose `realpath()` resolves outside `stagingRoot`. This
|
|
54
|
+
* catches what the platform extractor missed if it failed to defend
|
|
55
|
+
* against `..` traversal.
|
|
56
|
+
*
|
|
57
|
+
* Throws on any violation. The caller cleans up the staging dir.
|
|
58
|
+
*/
|
|
59
|
+
export declare function validateExtraction(stagingRoot: string): void;
|
|
60
|
+
export interface GithubAutoInstallResult {
|
|
61
|
+
cachedBinDirs: string[];
|
|
62
|
+
installsStarted: number;
|
|
63
|
+
skipped: Array<{
|
|
64
|
+
id: string;
|
|
65
|
+
reason: string;
|
|
66
|
+
}>;
|
|
67
|
+
/**
|
|
68
|
+
* Promise that resolves when every backgrounded GitHub install settles.
|
|
69
|
+
* Each install holds its per-package install lock for its full duration.
|
|
70
|
+
* Plugin startup ignores this; tests await it.
|
|
71
|
+
*/
|
|
72
|
+
installsComplete: Promise<void>;
|
|
73
|
+
}
|
|
74
|
+
export declare function abortInFlightGithubInstalls(): Promise<void>;
|
|
75
|
+
/**
|
|
76
|
+
* Run the GitHub-release auto-install pass for every Pattern C server.
|
|
77
|
+
*
|
|
78
|
+
* Sync return: per-server cached bin dirs + skipped reasons known at decision
|
|
79
|
+
* time. Backgrounded installs settle into `installsComplete` so plugin
|
|
80
|
+
* startup is not blocked on slow downloads.
|
|
81
|
+
*/
|
|
82
|
+
export declare function runGithubAutoInstall(relevantServers: ReadonlySet<string>, config: GithubInstallConfig, fetchImpl?: typeof fetch): GithubAutoInstallResult;
|
|
83
|
+
/**
|
|
84
|
+
* Cheap project-relevance scan for GitHub-distributed servers. Root markers
|
|
85
|
+
* win immediately; otherwise use the bounded shared extension walk for
|
|
86
|
+
* monorepos with nested source files.
|
|
87
|
+
*/
|
|
88
|
+
export declare function discoverRelevantGithubServers(projectRoot: string): Set<string>;
|
|
89
|
+
export { type Arch, detectHostPlatform, findGithubServerById, GITHUB_LSP_TABLE, type GithubServerSpec, type Platform, };
|
|
90
|
+
//# 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;AAiCH,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,EACd,MAAM,uBAAuB,CAAC;AAqB/B,yCAAyC;AACzC,wBAAgB,YAAY,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAG/E;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,gBAAgB,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CASrF;AASD,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;IAClB,wEAAwE;IACxE,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;CAC/B;AAwUD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CA0E5D;AAmSD,MAAM,WAAW,uBAAuB;IACtC,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC/C;;;;OAIG;IACH,gBAAgB,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;CACjC;AAsBD,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAMjE;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,eAAe,EAAE,WAAW,CAAC,MAAM,CAAC,EACpC,MAAM,EAAE,mBAAmB,EAC3B,SAAS,GAAE,OAAO,KAAa,GAC9B,uBAAuB,CAiFzB;AAID;;;;GAIG;AACH,wBAAgB,6BAA6B,CAAC,WAAW,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAyC9E;AAID,OAAO,EACL,KAAK,IAAI,EACT,kBAAkB,EAClB,oBAAoB,EACpB,gBAAgB,EAChB,KAAK,gBAAgB,EACrB,KAAK,QAAQ,GACd,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Probes the GitHub releases API for a project's tagged releases and
|
|
3
|
+
* selects the newest tag whose asset publication satisfies AFT's
|
|
4
|
+
* supply-chain grace window.
|
|
5
|
+
*
|
|
6
|
+
* Same threat model as the npm registry probe — we want releases that
|
|
7
|
+
* have been observable for at least `graceDays` so the community has
|
|
8
|
+
* time to detect compromised tarballs and yank them.
|
|
9
|
+
*
|
|
10
|
+
* For repos that put release tags on a `published_at` field (almost
|
|
11
|
+
* all of them), we filter on that. Pre-releases are skipped by default.
|
|
12
|
+
*/
|
|
13
|
+
interface GithubRelease {
|
|
14
|
+
tag_name: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
published_at?: string;
|
|
17
|
+
draft?: boolean;
|
|
18
|
+
prerelease?: boolean;
|
|
19
|
+
assets?: Array<{
|
|
20
|
+
name: string;
|
|
21
|
+
browser_download_url: string;
|
|
22
|
+
size?: number;
|
|
23
|
+
}>;
|
|
24
|
+
}
|
|
25
|
+
export interface GithubVersionPickResult {
|
|
26
|
+
/** Chosen release tag (e.g. "v21.1.0" or "21.1.0"), or null if none qualifies. */
|
|
27
|
+
tag: string | null;
|
|
28
|
+
/** Asset list of the chosen release — used to find the right archive. */
|
|
29
|
+
assets: Array<{
|
|
30
|
+
name: string;
|
|
31
|
+
url: string;
|
|
32
|
+
size?: number;
|
|
33
|
+
}>;
|
|
34
|
+
/** True when releases exist but none is older than `graceDays`. */
|
|
35
|
+
blockedByGrace: boolean;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Pick the newest non-draft non-prerelease release whose `published_at`
|
|
39
|
+
* is at least `graceDays` ago.
|
|
40
|
+
*
|
|
41
|
+
* The GitHub `/releases` endpoint returns up to 30 releases sorted newest
|
|
42
|
+
* first by default — pagination ignored because servers we care about
|
|
43
|
+
* cycle stable releases on the order of weeks/months.
|
|
44
|
+
*/
|
|
45
|
+
export declare function pickEligibleRelease(releases: readonly GithubRelease[], graceDays: number, now?: number): GithubVersionPickResult;
|
|
46
|
+
/**
|
|
47
|
+
* Fetch the GitHub releases list for `owner/repo` and apply the grace filter.
|
|
48
|
+
*
|
|
49
|
+
* Returns `null` on HTTP/network failure — caller should keep using whatever's
|
|
50
|
+
* already cached.
|
|
51
|
+
*/
|
|
52
|
+
export declare function probeGithubReleases(githubRepo: string, graceDays: number, fetchImpl?: typeof fetch): Promise<GithubVersionPickResult | null>;
|
|
53
|
+
/**
|
|
54
|
+
* Throw if `version` contains anything outside the safe allowlist.
|
|
55
|
+
*/
|
|
56
|
+
export declare function assertSafeVersion(version: string): void;
|
|
57
|
+
/**
|
|
58
|
+
* Strip a leading `v` from a release tag to get a clean version for asset
|
|
59
|
+
* templates that don't include the `v` prefix.
|
|
60
|
+
*
|
|
61
|
+
* Asserts the tag is safe via {@link assertSafeVersion} so callers can
|
|
62
|
+
* pass it into paths and command arguments without additional validation.
|
|
63
|
+
*/
|
|
64
|
+
export declare function stripTagV(tag: string): string;
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=lsp-github-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-github-probe.d.ts","sourceRoot":"","sources":["../src/lsp-github-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,UAAU,aAAa;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;QACb,oBAAoB,EAAE,MAAM,CAAC;QAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ;AAED,MAAM,WAAW,uBAAuB;IACtC,kFAAkF;IAClF,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,yEAAyE;IACzE,MAAM,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC5D,mEAAmE;IACnE,cAAc,EAAE,OAAO,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,SAAS,aAAa,EAAE,EAClC,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,GACvB,uBAAuB,CA4BzB;AAED;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAyBzC;AAiBD;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAMvD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAG7C"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-server GitHub-release configuration for LSP servers AFT can
|
|
3
|
+
* auto-download.
|
|
4
|
+
*
|
|
5
|
+
* Each entry is a templated asset-name pattern keyed by `(platform, arch)`.
|
|
6
|
+
* The installer resolves the latest eligible release tag (with 7-day grace),
|
|
7
|
+
* matches the asset against `assetTemplate(platform, arch, version)`,
|
|
8
|
+
* downloads it, extracts to the cache, and exposes the binary.
|
|
9
|
+
*
|
|
10
|
+
* NOTE: terraform-ls uses HashiCorp's release API, not GitHub. It's a
|
|
11
|
+
* separate code path; not included in this table.
|
|
12
|
+
*
|
|
13
|
+
* NOTE: oxlint is bundled inside the project's `node_modules/@oxlint/*`
|
|
14
|
+
* package via the existing project-node_modules resolution. AFT does not
|
|
15
|
+
* download it independently. Excluded from this table.
|
|
16
|
+
*
|
|
17
|
+
* NOTE: kotlin-language-server is hosted on JetBrains CDN, not GitHub.
|
|
18
|
+
* Skipped from auto-download for v0.17.0 — users install via Homebrew /
|
|
19
|
+
* scoop / Snap / coursier.
|
|
20
|
+
*/
|
|
21
|
+
export type Platform = "darwin" | "linux" | "win32";
|
|
22
|
+
export type Arch = "x64" | "arm64";
|
|
23
|
+
/**
|
|
24
|
+
* Asset name template — receives platform/arch (already mapped to the
|
|
25
|
+
* project's naming convention) and the resolved version, returns the
|
|
26
|
+
* literal asset filename to look for in the release `assets[]`.
|
|
27
|
+
*
|
|
28
|
+
* Returns `null` when this platform/arch combo is unsupported.
|
|
29
|
+
*/
|
|
30
|
+
export type AssetTemplate = (platform: Platform, arch: Arch, version: string) => string | null;
|
|
31
|
+
export type ArchiveType = "tar.gz" | "tar.xz" | "zip";
|
|
32
|
+
export interface GithubServerSpec {
|
|
33
|
+
/** AFT server-kind id (matches `crates/aft/src/lsp/registry.rs::ServerKind::id_str`). */
|
|
34
|
+
readonly id: string;
|
|
35
|
+
/** GitHub `owner/repo`. */
|
|
36
|
+
readonly githubRepo: string;
|
|
37
|
+
/** Binary name placed under the cache `bin/` dir after extraction. */
|
|
38
|
+
readonly binary: string;
|
|
39
|
+
/** Returns the asset filename and archive type for the given platform/arch + version. */
|
|
40
|
+
readonly resolveAsset: (platform: Platform, arch: Arch, version: string) => {
|
|
41
|
+
name: string;
|
|
42
|
+
archive: ArchiveType;
|
|
43
|
+
} | null;
|
|
44
|
+
/**
|
|
45
|
+
* Path inside the extracted archive where the binary lives, relative to the
|
|
46
|
+
* extraction root. May contain `${version}` placeholder. The installer
|
|
47
|
+
* looks up this path and copies/symlinks it to `bin/<binary>`.
|
|
48
|
+
*/
|
|
49
|
+
readonly binaryPathInArchive: (platform: Platform, arch: Arch, version: string) => string;
|
|
50
|
+
}
|
|
51
|
+
export declare const GITHUB_LSP_TABLE: readonly GithubServerSpec[];
|
|
52
|
+
/** Find an entry by AFT server id. */
|
|
53
|
+
export declare function findGithubServerById(id: string): GithubServerSpec | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Map Node's `process.platform` and `process.arch` to our (Platform, Arch)
|
|
56
|
+
* pair, or null when the host isn't supported.
|
|
57
|
+
*/
|
|
58
|
+
export declare function detectHostPlatform(): {
|
|
59
|
+
platform: Platform;
|
|
60
|
+
arch: Arch;
|
|
61
|
+
} | null;
|
|
62
|
+
//# sourceMappingURL=lsp-github-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-github-table.d.ts","sourceRoot":"","sources":["../src/lsp-github-table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC;AACpD,MAAM,MAAM,IAAI,GAAG,KAAK,GAAG,OAAO,CAAC;AAEnC;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;AAE/F,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAEtD,MAAM,WAAW,gBAAgB;IAC/B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,2BAA2B;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,sEAAsE;IACtE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yFAAyF;IACzF,QAAQ,CAAC,YAAY,EAAE,CACrB,QAAQ,EAAE,QAAQ,EAClB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,KACZ;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,GAAG,IAAI,CAAC;IACnD;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,KAAK,MAAM,CAAC;CAC3F;AA4HD,eAAO,MAAM,gBAAgB,EAAE,SAAS,gBAAgB,EAMvD,CAAC;AAEF,sCAAsC;AACtC,wBAAgB,oBAAoB,CAAC,EAAE,EAAE,MAAM,GAAG,gBAAgB,GAAG,SAAS,CAE7E;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,IAAI,CAAA;CAAE,GAAG,IAAI,CAQ9E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Maps AFT LSP server kinds to their npm packages and the binary names
|
|
3
|
+
* exposed in `node_modules/.bin/` after install.
|
|
4
|
+
*
|
|
5
|
+
* Used by the auto-install flow to decide which packages to fetch and to
|
|
6
|
+
* compute the `lsp_paths_extra` directory list passed to the Rust binary.
|
|
7
|
+
*
|
|
8
|
+
* Coverage matches OpenCode's `lsp/server.ts` `Npm.which(...)` calls. Any
|
|
9
|
+
* server NOT in this table is either:
|
|
10
|
+
* 1. Pattern A (PATH-only, install via system package manager)
|
|
11
|
+
* 2. Pattern C (GitHub-release auto-download — see lsp-github-table.ts)
|
|
12
|
+
* 3. Special (eslint/prisma — uses project's own node_modules)
|
|
13
|
+
*/
|
|
14
|
+
export interface NpmServerSpec {
|
|
15
|
+
/** AFT server-kind id (matches `crates/aft/src/lsp/registry.rs::ServerKind::id_str`). */
|
|
16
|
+
readonly id: string;
|
|
17
|
+
/** npm package name. */
|
|
18
|
+
readonly npm: string;
|
|
19
|
+
/** Binary name installed under `node_modules/.bin/`. */
|
|
20
|
+
readonly binary: string;
|
|
21
|
+
/** File extensions (without dot) the LSP serves. Used for project-relevance discovery. */
|
|
22
|
+
readonly extensions: readonly string[];
|
|
23
|
+
/** Project-root marker files (presence triggers install). Optional. */
|
|
24
|
+
readonly rootMarkers?: readonly string[];
|
|
25
|
+
}
|
|
26
|
+
export declare const NPM_LSP_TABLE: readonly NpmServerSpec[];
|
|
27
|
+
/** Find an entry by AFT server id. */
|
|
28
|
+
export declare function findNpmServerById(id: string): NpmServerSpec | undefined;
|
|
29
|
+
/** Find an entry by binary name. */
|
|
30
|
+
export declare function findNpmServerByBinary(binary: string): NpmServerSpec | undefined;
|
|
31
|
+
//# sourceMappingURL=lsp-npm-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-npm-table.d.ts","sourceRoot":"","sources":["../src/lsp-npm-table.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,MAAM,WAAW,aAAa;IAC5B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,wBAAwB;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,0FAA0F;IAC1F,QAAQ,CAAC,UAAU,EAAE,SAAS,MAAM,EAAE,CAAC;IACvC,uEAAuE;IACvE,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1C;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,aAAa,EAoEjD,CAAC;AAEF,sCAAsC;AACtC,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAEvE;AAED,oCAAoC;AACpC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAE/E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function hasRootMarker(projectRoot: string, rootMarkers?: readonly string[]): boolean;
|
|
2
|
+
/**
|
|
3
|
+
* Bounded extension scan for project relevance decisions.
|
|
4
|
+
*
|
|
5
|
+
* Root-marker checks happen before callers use this helper. This walk only
|
|
6
|
+
* answers "does this project contain one of the extensions we know how to
|
|
7
|
+
* serve?" and deliberately skips common dependency/build/cache directories so
|
|
8
|
+
* vendored files do not trigger heavyweight LSP installs.
|
|
9
|
+
*/
|
|
10
|
+
export declare function relevantExtensionsInProject(projectRoot: string, extToServer: Readonly<Record<string, readonly string[]>>): Set<string>;
|
|
11
|
+
//# sourceMappingURL=lsp-project-relevance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-project-relevance.d.ts","sourceRoot":"","sources":["../src/lsp-project-relevance.ts"],"names":[],"mappings":"AAiBA,wBAAgB,aAAa,CAAC,WAAW,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAM3F;AAED;;;;;;;GAOG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,GACvD,GAAG,CAAC,MAAM,CAAC,CAmCb"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Probes the npm registry for a package's available versions and selects
|
|
3
|
+
* the newest one that satisfies AFT's supply-chain grace window.
|
|
4
|
+
*
|
|
5
|
+
* Threat model: defends against typosquat/compromise attacks where a
|
|
6
|
+
* malicious version is published, then yanked within hours when caught.
|
|
7
|
+
* By default, AFT only installs versions that have been on the registry
|
|
8
|
+
* for at least 7 days, giving the community time to detect and respond.
|
|
9
|
+
*
|
|
10
|
+
* Grace days are configurable via `lsp.grace_days` (default 7). User
|
|
11
|
+
* pins via `lsp.versions: { "package": "X.Y.Z" }` bypass the filter.
|
|
12
|
+
*/
|
|
13
|
+
/** Per-version publish times indexed by version string. */
|
|
14
|
+
type VersionTimes = Record<string, string>;
|
|
15
|
+
interface RegistryResponse {
|
|
16
|
+
/** Map: version → ISO publish time. Also contains "created" / "modified". */
|
|
17
|
+
time?: VersionTimes;
|
|
18
|
+
/** dist-tags such as "latest", "next". */
|
|
19
|
+
"dist-tags"?: {
|
|
20
|
+
latest?: string;
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export interface VersionPickResult {
|
|
24
|
+
/** The chosen version, or null if none qualifies. */
|
|
25
|
+
version: string | null;
|
|
26
|
+
/** True when the registry has versions but none is older than `graceDays`. */
|
|
27
|
+
blockedByGrace: boolean;
|
|
28
|
+
/** All eligible versions sorted by publish date (newest first). For tests/logs. */
|
|
29
|
+
eligible: ReadonlyArray<{
|
|
30
|
+
version: string;
|
|
31
|
+
publishedAt: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Pick a version from the registry response that:
|
|
36
|
+
* 1. is published at least `graceDays` ago
|
|
37
|
+
* 2. is the newest such version (per ISO publish time)
|
|
38
|
+
*
|
|
39
|
+
* Pre-release versions (semver "-" tags) are skipped.
|
|
40
|
+
*/
|
|
41
|
+
export declare function pickEligibleVersion(response: RegistryResponse, graceDays: number, now?: number): VersionPickResult;
|
|
42
|
+
/**
|
|
43
|
+
* Fetch the registry document for `npmPackage` and apply the grace filter.
|
|
44
|
+
*
|
|
45
|
+
* Returns `null` on HTTP/network failure (logs a warning) so callers can
|
|
46
|
+
* fall back to "use whatever's currently installed".
|
|
47
|
+
*/
|
|
48
|
+
export declare function probeRegistry(npmPackage: string, graceDays: number, fetchImpl?: typeof fetch): Promise<VersionPickResult | null>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=lsp-registry-probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lsp-registry-probe.d.ts","sourceRoot":"","sources":["../src/lsp-registry-probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,2DAA2D;AAC3D,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE3C,UAAU,gBAAgB;IACxB,6EAA6E;IAC7E,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,0CAA0C;IAC1C,WAAW,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACnC;AAED,MAAM,WAAW,iBAAiB;IAChC,qDAAqD;IACrD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,8EAA8E;IAC9E,cAAc,EAAE,OAAO,CAAC;IACxB,mFAAmF;IACnF,QAAQ,EAAE,aAAa,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACnE;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,gBAAgB,EAC1B,SAAS,EAAE,MAAM,EACjB,GAAG,GAAE,MAAmB,GACvB,iBAAiB,CA0BnB;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,SAAS,GAAE,OAAO,KAAa,GAC9B,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAoBnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onnx-runtime.d.ts","sourceRoot":"","sources":["../src/onnx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0DH,4DAA4D;AAC5D,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BlF;
|
|
1
|
+
{"version":3,"file":"onnx-runtime.d.ts","sourceRoot":"","sources":["../src/onnx-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0DH,4DAA4D;AAC5D,wBAAgB,0BAA0B,IAAI,OAAO,CAEpD;AAED,6EAA6E;AAC7E,wBAAgB,oBAAoB,IAAI,MAAM,CAQ7C;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4BlF;AAmKD;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAU3D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cortexkit/aft-pi",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pi coding agent extension for Agent File Tools (AFT) — tree-sitter and LSP-powered code analysis",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"zod": "^4.1.8"
|
|
27
27
|
},
|
|
28
28
|
"optionalDependencies": {
|
|
29
|
-
"@cortexkit/aft-darwin-arm64": "0.
|
|
30
|
-
"@cortexkit/aft-darwin-x64": "0.
|
|
31
|
-
"@cortexkit/aft-linux-arm64": "0.
|
|
32
|
-
"@cortexkit/aft-linux-x64": "0.
|
|
33
|
-
"@cortexkit/aft-win32-x64": "0.
|
|
29
|
+
"@cortexkit/aft-darwin-arm64": "0.17.0",
|
|
30
|
+
"@cortexkit/aft-darwin-x64": "0.17.0",
|
|
31
|
+
"@cortexkit/aft-linux-arm64": "0.17.0",
|
|
32
|
+
"@cortexkit/aft-linux-x64": "0.17.0",
|
|
33
|
+
"@cortexkit/aft-win32-x64": "0.17.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@mariozechner/pi-coding-agent": "*",
|