@ttsc/graph 0.26.2 → 0.27.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/lib/nativeExecutable.js
CHANGED
|
@@ -47,7 +47,7 @@ function ensureExecutable(binary) {
|
|
|
47
47
|
* property of the runtime rather than a budget chosen here.
|
|
48
48
|
*/
|
|
49
49
|
function captureProcessOutput() {
|
|
50
|
-
const directory =
|
|
50
|
+
const directory = createCanonicalTempDirectory("ttscgraph-spawn-");
|
|
51
51
|
const stdoutPath = node_path_1.default.join(directory, "stdout");
|
|
52
52
|
const stderrPath = node_path_1.default.join(directory, "stderr");
|
|
53
53
|
const stdoutFd = node_fs_1.default.openSync(stdoutPath, "w+");
|
|
@@ -82,6 +82,22 @@ function captureProcessOutput() {
|
|
|
82
82
|
stdoutFd,
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
|
+
/** Create capture storage beneath the frozen physical system-temp parent. */
|
|
86
|
+
function createCanonicalTempDirectory(prefix) {
|
|
87
|
+
const physicalParent = node_fs_1.default.realpathSync.native(node_os_1.default.tmpdir());
|
|
88
|
+
if (!node_fs_1.default.lstatSync(physicalParent).isDirectory()) {
|
|
89
|
+
throw new Error(`@ttsc/graph: temporary directory parent is not a directory: ${physicalParent}`);
|
|
90
|
+
}
|
|
91
|
+
const directory = node_fs_1.default.mkdtempSync(node_path_1.default.join(physicalParent, prefix));
|
|
92
|
+
if (!node_fs_1.default.lstatSync(directory).isDirectory()) {
|
|
93
|
+
throw new Error(`@ttsc/graph: temporary directory postflight is not a directory: ${directory}`);
|
|
94
|
+
}
|
|
95
|
+
const physicalDirectory = node_fs_1.default.realpathSync.native(directory);
|
|
96
|
+
if (node_path_1.default.dirname(physicalDirectory) !== physicalParent) {
|
|
97
|
+
throw new Error(`@ttsc/graph: temporary directory escaped its physical parent: ${physicalDirectory}`);
|
|
98
|
+
}
|
|
99
|
+
return physicalDirectory;
|
|
100
|
+
}
|
|
85
101
|
/** Close a descriptor, ignoring one that is already closed. */
|
|
86
102
|
function closeQuietly(fd) {
|
|
87
103
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeExecutable.js","sourceRoot":"","sources":["../src/nativeExecutable.ts"],"names":[],"mappings":";;;;;;;AAAA,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B;;;;;;;GAOG;AACH,0BAAiC,MAAc;IAC7C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO;IACzC,IAAI,CAAC;QACH,iBAAE,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,iBAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC;YAC9C,iBAAE,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,GAAG,KAAK,CAAC,CAAC;QACrC,CAAC;QAAC,MAAM,CAAC;YACP,wCAAwC;QAC1C,CAAC;IACH,CAAC;AACH,CAAC;AAWD;;;;;;;;;;;;GAYG;AACH;IACE,MAAM,SAAS,GAAG,
|
|
1
|
+
{"version":3,"file":"nativeExecutable.js","sourceRoot":"","sources":["../src/nativeExecutable.ts"],"names":[],"mappings":";;;;;;;AAAA,sDAAyB;AACzB,sDAAyB;AACzB,0DAA6B;AAE7B;;;;;;;GAOG;AACH,0BAAiC,MAAc;IAC7C,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO;QAAE,OAAO;IACzC,IAAI,CAAC;QACH,iBAAE,CAAC,UAAU,CAAC,MAAM,EAAE,iBAAE,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO;IACT,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,iBAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAA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E,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAAC,MAAM,CAAC;QACP,eAAe;IACjB,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ttsc/graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.27.0",
|
|
4
4
|
"description": "Checker-resolved architecture graph over MCP for coding agents, backed by ttsc's in-process TypeScript-Go compiler.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib/index.d.ts",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"typia": "13.2.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"ttsc": "^0.
|
|
23
|
+
"ttsc": "^0.27.0"
|
|
24
24
|
},
|
|
25
25
|
"keywords": [
|
|
26
26
|
"ttsc",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"three": "^0.184.0",
|
|
43
43
|
"three-forcegraph": "^1.43.4",
|
|
44
44
|
"typescript": "^7.0.2",
|
|
45
|
-
"ttsc": "0.
|
|
45
|
+
"ttsc": "0.27.0"
|
|
46
46
|
},
|
|
47
47
|
"repository": {
|
|
48
48
|
"type": "git",
|
package/src/nativeExecutable.ts
CHANGED
|
@@ -48,7 +48,7 @@ export interface CapturedProcessOutput {
|
|
|
48
48
|
* property of the runtime rather than a budget chosen here.
|
|
49
49
|
*/
|
|
50
50
|
export function captureProcessOutput(): CapturedProcessOutput {
|
|
51
|
-
const directory =
|
|
51
|
+
const directory = createCanonicalTempDirectory("ttscgraph-spawn-");
|
|
52
52
|
const stdoutPath = path.join(directory, "stdout");
|
|
53
53
|
const stderrPath = path.join(directory, "stderr");
|
|
54
54
|
const stdoutFd = fs.openSync(stdoutPath, "w+");
|
|
@@ -82,6 +82,29 @@ export function captureProcessOutput(): CapturedProcessOutput {
|
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
|
|
85
|
+
/** Create capture storage beneath the frozen physical system-temp parent. */
|
|
86
|
+
function createCanonicalTempDirectory(prefix: string): string {
|
|
87
|
+
const physicalParent = fs.realpathSync.native(os.tmpdir());
|
|
88
|
+
if (!fs.lstatSync(physicalParent).isDirectory()) {
|
|
89
|
+
throw new Error(
|
|
90
|
+
`@ttsc/graph: temporary directory parent is not a directory: ${physicalParent}`,
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
const directory = fs.mkdtempSync(path.join(physicalParent, prefix));
|
|
94
|
+
if (!fs.lstatSync(directory).isDirectory()) {
|
|
95
|
+
throw new Error(
|
|
96
|
+
`@ttsc/graph: temporary directory postflight is not a directory: ${directory}`,
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
const physicalDirectory = fs.realpathSync.native(directory);
|
|
100
|
+
if (path.dirname(physicalDirectory) !== physicalParent) {
|
|
101
|
+
throw new Error(
|
|
102
|
+
`@ttsc/graph: temporary directory escaped its physical parent: ${physicalDirectory}`,
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
return physicalDirectory;
|
|
106
|
+
}
|
|
107
|
+
|
|
85
108
|
/** Close a descriptor, ignoring one that is already closed. */
|
|
86
109
|
function closeQuietly(fd: number): void {
|
|
87
110
|
try {
|