@adhdev/daemon-core 0.9.82-rc.318 → 0.9.82-rc.319
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/cli-adapters/provider-cli-runtime.d.ts +34 -0
- package/dist/detection/ide-detector.d.ts +13 -0
- package/dist/detection/win32-ide-version.d.ts +37 -0
- package/dist/index.js +1100 -956
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1120 -976
- package/dist/index.mjs.map +1 -1
- package/dist/providers/spec/adapter.d.ts +10 -0
- package/dist/providers/working-dir.d.ts +17 -0
- package/package.json +2 -2
- package/src/cli-adapters/provider-cli-runtime.ts +54 -7
- package/src/detection/ide-detector.ts +31 -2
- package/src/detection/win32-ide-version.ts +106 -0
- package/src/mesh/mesh-events-coordinator.ts +124 -22
- package/src/providers/acp-provider-instance.ts +4 -3
- package/src/providers/cli-provider-instance.ts +5 -4
- package/src/providers/spec/adapter.ts +14 -1
- package/src/providers/spec/fsm-driver.ts +29 -8
- package/src/providers/version-archive.ts +28 -6
- package/src/providers/working-dir.ts +23 -0
|
@@ -17,6 +17,40 @@ export declare function resolveCliSpawnPlan(options: {
|
|
|
17
17
|
extraArgs: string[];
|
|
18
18
|
extraEnv?: Record<string, string>;
|
|
19
19
|
}): CliSpawnPlan;
|
|
20
|
+
/**
|
|
21
|
+
* Cols/rows for a PTY spawn. Defaults to the session-host terminal size; the
|
|
22
|
+
* spec driver may override per-instance.
|
|
23
|
+
*/
|
|
24
|
+
export interface CliSpawnGeometry {
|
|
25
|
+
cols?: number;
|
|
26
|
+
rows?: number;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Core spawn-plan resolution from already-flattened spawn parts — the single
|
|
30
|
+
* source of truth for binary resolution (findBinary: PATH + npm-global / Node
|
|
31
|
+
* dir fallback), `{{workingDir}}` token substitution, shell wrapping
|
|
32
|
+
* (script-shims / non-absolute / non-native binaries), and env sanitization +
|
|
33
|
+
* TERMINAL_CWD. Both the legacy provider-module path (resolveCliSpawnPlan) and
|
|
34
|
+
* the spec/FSM path (FsmDriver.buildAdapterOpts) feed into this so the two
|
|
35
|
+
* spawn paths can never diverge.
|
|
36
|
+
*/
|
|
37
|
+
export declare function resolveCliSpawnPlanFromParts(options: {
|
|
38
|
+
/** Raw command from the spec/provider (`binary` / `spawn.command`), or an
|
|
39
|
+
* operator-configured executable path override. */
|
|
40
|
+
command: string;
|
|
41
|
+
/** Base launch args declared by the spec/provider (`spawn_args` /
|
|
42
|
+
* `spawn.args`). */
|
|
43
|
+
baseArgs?: string[];
|
|
44
|
+
/** When true, always wrap the launch in a login shell. */
|
|
45
|
+
shell?: boolean;
|
|
46
|
+
/** Base env declared by the spec/provider (`env` / `spawn.env`). */
|
|
47
|
+
baseEnv?: Record<string, string>;
|
|
48
|
+
workingDir: string;
|
|
49
|
+
/** Per-launch extra args (e.g. resume session id) appended after baseArgs. */
|
|
50
|
+
extraArgs?: string[];
|
|
51
|
+
extraEnv?: Record<string, string>;
|
|
52
|
+
geometry?: CliSpawnGeometry;
|
|
53
|
+
}): CliSpawnPlan;
|
|
20
54
|
export declare function buildCliLoginShellRetry(plan: Pick<CliSpawnPlan, 'binaryPath' | 'allArgs'>): {
|
|
21
55
|
shellCmd: string;
|
|
22
56
|
shellArgs: string[];
|
|
@@ -32,4 +32,17 @@ export interface IDEDefinition {
|
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
export declare function registerIDEDefinition(def: IDEDefinition): void;
|
|
35
|
+
/**
|
|
36
|
+
* Resolve an IDE version on demand (NOT at boot).
|
|
37
|
+
*
|
|
38
|
+
* Order of preference, all spawn-free where possible:
|
|
39
|
+
* 1. win32: read the bundled product.json/package.json next to the exe.
|
|
40
|
+
* 2. Otherwise spawn `<cli> --version` — but ONLY when the binary is not a
|
|
41
|
+
* known GUI executable (the #4 guard), so we never boot an IDE window.
|
|
42
|
+
*
|
|
43
|
+
* `win32ProcessNames` is provider.json `processNames.win32` (type → exe names),
|
|
44
|
+
* used to recognise GUI executables. Callers that have a ProviderLoader can
|
|
45
|
+
* pass `providerLoader.getWinProcessNames()`.
|
|
46
|
+
*/
|
|
47
|
+
export declare function getIdeVersion(cliCommand: string, win32ProcessNames?: Record<string, string[]>): Promise<string | null>;
|
|
35
48
|
export declare function detectIDEs(providerLoader?: ProviderLoader): Promise<IDEInfo[]>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ADHDev — Windows IDE version detection (execution-free)
|
|
3
|
+
*
|
|
4
|
+
* On Windows the resolved "CLI" for a VS Code fork (Cursor, Antigravity, …)
|
|
5
|
+
* frequently resolves to the GUI Electron executable itself, because the
|
|
6
|
+
* case-insensitive filesystem matches `...\cursor\cursor.exe` against the
|
|
7
|
+
* real `Cursor.exe`. Running `<that exe> --version` boots the GUI instead of
|
|
8
|
+
* printing a version (Electron ignores the unknown flag and opens a window).
|
|
9
|
+
*
|
|
10
|
+
* To learn the version WITHOUT spawning anything, we read the bundled
|
|
11
|
+
* `product.json` / `package.json` that ship next to the executable. VS Code
|
|
12
|
+
* forks embed their version there. This is a pure filesystem read.
|
|
13
|
+
*
|
|
14
|
+
* It also exposes a guard so any remaining `--version` exec path can refuse to
|
|
15
|
+
* spawn a binary that is a known GUI executable for an IDE provider.
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* Read an IDE version from disk (no process spawn).
|
|
19
|
+
*
|
|
20
|
+
* @param exePath Absolute path to the GUI executable (or any path inside the
|
|
21
|
+
* IDE install dir — we read the manifest relative to its directory).
|
|
22
|
+
* @returns The version string, or null if it could not be determined.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readWin32IdeVersionFromDisk(exePath: string): string | null;
|
|
25
|
+
/**
|
|
26
|
+
* True when `binPath` resolves to a known GUI executable for some IDE.
|
|
27
|
+
*
|
|
28
|
+
* Used as a safety net: any code path about to run `<bin> --version` must skip
|
|
29
|
+
* the spawn when the binary is actually the GUI Electron exe, since that would
|
|
30
|
+
* launch the IDE window. Comparison is case-insensitive on the basename
|
|
31
|
+
* (Windows filesystem semantics) against every provider's `processNames.win32`.
|
|
32
|
+
*
|
|
33
|
+
* @param binPath Resolved binary path that would be exec'd.
|
|
34
|
+
* @param win32ProcessNames Map of provider type → list of GUI exe names
|
|
35
|
+
* (from provider.json `processNames.win32`, e.g. `["Cursor.exe"]`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function isKnownWin32GuiExe(binPath: string | null | undefined, win32ProcessNames: Record<string, string[]>): boolean;
|