@cortexkit/aft-bridge 0.39.3 → 0.40.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 +0 -1
- package/dist/bash-format.d.ts.map +1 -1
- package/dist/bash-format.js +0 -3
- package/dist/bash-format.js.map +1 -1
- package/dist/bash-hints.js +97 -9
- package/dist/bash-hints.js.map +1 -1
- package/dist/bridge.d.ts +23 -1
- package/dist/bridge.d.ts.map +1 -1
- package/dist/bridge.js +63 -43
- package/dist/bridge.js.map +1 -1
- package/dist/callgraph-format.d.ts.map +1 -1
- package/dist/callgraph-format.js +27 -14
- package/dist/callgraph-format.js.map +1 -1
- package/dist/coerce.d.ts +39 -0
- package/dist/coerce.d.ts.map +1 -1
- package/dist/coerce.js +82 -0
- package/dist/coerce.js.map +1 -1
- package/dist/command-timeouts.d.ts.map +1 -1
- package/dist/command-timeouts.js +1 -0
- package/dist/command-timeouts.js.map +1 -1
- package/dist/config-tiers.d.ts +19 -0
- package/dist/config-tiers.d.ts.map +1 -0
- package/dist/config-tiers.js +45 -0
- package/dist/config-tiers.js.map +1 -0
- package/dist/edit-summary.d.ts +5 -0
- package/dist/edit-summary.d.ts.map +1 -1
- package/dist/edit-summary.js +12 -2
- package/dist/edit-summary.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/migration.d.ts +27 -0
- package/dist/migration.d.ts.map +1 -1
- package/dist/migration.js +384 -2
- package/dist/migration.js.map +1 -1
- package/dist/onnx-runtime.d.ts +4 -6
- package/dist/onnx-runtime.d.ts.map +1 -1
- package/dist/onnx-runtime.js +13 -15
- package/dist/onnx-runtime.js.map +1 -1
- package/dist/paths.d.ts +17 -0
- package/dist/paths.d.ts.map +1 -1
- package/dist/paths.js +52 -1
- package/dist/paths.js.map +1 -1
- package/dist/pool.d.ts.map +1 -1
- package/dist/pool.js +15 -16
- package/dist/pool.js.map +1 -1
- package/dist/project-identity.d.ts +30 -0
- package/dist/project-identity.d.ts.map +1 -0
- package/dist/project-identity.js +69 -0
- package/dist/project-identity.js.map +1 -0
- package/package.json +1 -1
- package/dist/pipe-strip.d.ts +0 -7
- package/dist/pipe-strip.d.ts.map +0 -1
- package/dist/pipe-strip.js +0 -688
- package/dist/pipe-strip.js.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { realpathSync } from "node:fs";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
/**
|
|
5
|
+
* The single TypeScript project-root canonicalizer, mirroring the Rust
|
|
6
|
+
* `cortexkit-paths` `ProjectRootId`: resolve symlinks (`realpath`), strip
|
|
7
|
+
* trailing separators, normalize Windows verbatim/UNC prefixes, and uppercase
|
|
8
|
+
* the drive letter. Falls back to lexical resolution for paths that don't
|
|
9
|
+
* exist (so callers that canonicalize a not-yet-created or transient path stay
|
|
10
|
+
* total instead of throwing).
|
|
11
|
+
*
|
|
12
|
+
* Why one canonicalizer: AFT used to derive project-root identity four
|
|
13
|
+
* different ways across the TS layer — bridge routing realpath'd, but RPC
|
|
14
|
+
* port-file scoping (`projectHash`) and the sidebar status gate compared raw
|
|
15
|
+
* strings. That divergence is the bug behind sidebar-shows-wrong-project and
|
|
16
|
+
* stale-port discovery: a symlinked / raw-spelled launch dir hashed to a
|
|
17
|
+
* different port directory than the bridge routed to.
|
|
18
|
+
*
|
|
19
|
+
* TS↔Rust *pixel* parity is NOT required (under the daemon, subc and AFT
|
|
20
|
+
* re-canonicalize the received root authoritatively). What IS required is
|
|
21
|
+
* TS-internal self-consistency: every routing, scoping, and port-file site
|
|
22
|
+
* routes through THIS function, so the bridge routing key and the RPC port
|
|
23
|
+
* scope always agree for the same project.
|
|
24
|
+
*/
|
|
25
|
+
export function canonicalizeProjectRoot(dir) {
|
|
26
|
+
const trimmed = dir.replace(/[/\\]+$/, "");
|
|
27
|
+
let canonical;
|
|
28
|
+
try {
|
|
29
|
+
canonical = realpathSync(trimmed);
|
|
30
|
+
}
|
|
31
|
+
catch {
|
|
32
|
+
canonical = resolve(trimmed);
|
|
33
|
+
}
|
|
34
|
+
return normalizeWindowsRoot(canonical);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Strip Windows extended-length verbatim prefixes (`\\?\`, `\\?\UNC\`) and
|
|
38
|
+
* uppercase a lowercase drive letter so `c:\x` and `C:\x` collapse to one
|
|
39
|
+
* identity. Mirrors `cortexkit-paths`' `windows_non_verbatim_path`. No-op off
|
|
40
|
+
* Windows.
|
|
41
|
+
*/
|
|
42
|
+
function normalizeWindowsRoot(p) {
|
|
43
|
+
if (process.platform !== "win32")
|
|
44
|
+
return p;
|
|
45
|
+
let s = p;
|
|
46
|
+
if (s.startsWith("\\\\?\\UNC\\")) {
|
|
47
|
+
s = `\\\\${s.slice("\\\\?\\UNC\\".length)}`;
|
|
48
|
+
}
|
|
49
|
+
else if (s.startsWith("\\\\?\\")) {
|
|
50
|
+
s = s.slice("\\\\?\\".length);
|
|
51
|
+
}
|
|
52
|
+
if (s.length >= 2 && s[1] === ":") {
|
|
53
|
+
const drive = s.charCodeAt(0);
|
|
54
|
+
if (drive >= 97 && drive <= 122) {
|
|
55
|
+
s = s[0].toUpperCase() + s.slice(1);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return s;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Stable 16-hex scope hash of the canonical project root. Used for RPC
|
|
62
|
+
* port-file directory scoping; because it canonicalizes first, the server
|
|
63
|
+
* writing a port file and the client discovering it agree on the directory
|
|
64
|
+
* even when one was handed a symlinked or raw-spelled path.
|
|
65
|
+
*/
|
|
66
|
+
export function projectRootKeyHash(dir) {
|
|
67
|
+
return createHash("sha256").update(canonicalizeProjectRoot(dir)).digest("hex").slice(0, 16);
|
|
68
|
+
}
|
|
69
|
+
//# sourceMappingURL=project-identity.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C,CAAC,CAAC,CAAC;QAC9B,IAAI,KAAK,IAAI,EAAE,IAAI,KAAK,IAAI,GAAG,EAAE,CAAC;YAChC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC5C,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,uBAAuB,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AAC9F,CAAC"}
|
package/package.json
CHANGED
package/dist/pipe-strip.d.ts
DELETED
package/dist/pipe-strip.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pipe-strip.d.ts","sourceRoot":"","sources":["../src/pipe-strip.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAkDD,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,MAAM,EACf,kBAAkB,EAAE,OAAO,GAC1B,eAAe,CA0BjB"}
|