@intentic/scaffold 1.165.0 → 1.167.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/exec.d.ts +1 -1
- package/dist/exec.d.ts.map +1 -1
- package/dist/exec.js +81 -6
- package/dist/exec.js.map +1 -1
- package/dist/git-forker.d.ts +17 -0
- package/dist/git-forker.d.ts.map +1 -0
- package/dist/git-forker.js +25 -0
- package/dist/git-forker.js.map +1 -0
- package/package.json +3 -3
package/dist/exec.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { execFile } from "node:child_process";
|
|
2
2
|
export declare const exec: typeof execFile.__promisify__;
|
|
3
3
|
export declare const GIT_GLOBAL_ARGS: readonly ["--no-optional-locks", "-c", "core.fileMode=false"];
|
|
4
|
-
export type GitRunner = (dir: string, args: readonly string[]) => Promise<{
|
|
4
|
+
export type GitRunner = (dir: string, args: readonly string[], env?: Readonly<Record<string, string>>) => Promise<{
|
|
5
5
|
readonly stdout: string;
|
|
6
6
|
readonly stderr: string;
|
|
7
7
|
}>;
|
package/dist/exec.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAqB,QAAQ,EAAQ,MAAM,oBAAoB,CAAC;AAOvE,eAAO,MAAM,IAAI,+BAAsB,CAAC;AAcxC,eAAO,MAAM,eAAe,YAAI,qBAAqB,EAAE,IAAI,EAAE,qBAAqB,CAAU,CAAC;AA+B7F,MAAM,MAAM,SAAS,GAAG,CACpB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,KACrC,OAAO,CAAC;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAWnE,eAAO,MAAM,QAAQ,QAAe,MAAM,QAAQ,SAAS,MAAM,EAAE,YAAY,MAAM,KAAG,OAAO,CAAC,MAAM,CAGrG,CAAC;AA0IF,eAAO,MAAM,UAAU,EAAE,SAAiC,CAAC;AAO3D,eAAO,MAAM,SAAS,EAAE,SASvB,CAAC"}
|
package/dist/exec.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { execFile } from "node:child_process";
|
|
1
|
+
import { execFile, fork } from "node:child_process";
|
|
2
|
+
import { existsSync } from "node:fs";
|
|
2
3
|
import { promisify } from "node:util";
|
|
3
4
|
export const exec = promisify(execFile);
|
|
4
5
|
export const GIT_GLOBAL_ARGS = ["--no-optional-locks", "-c", "core.fileMode=false"];
|
|
@@ -13,11 +14,85 @@ export const gitBytes = async (dir, args, maxBytes) => {
|
|
|
13
14
|
const { stdout } = await exec("git", [...GIT_GLOBAL_ARGS, "-C", dir, ...args], { maxBuffer: maxBytes, encoding: "buffer" });
|
|
14
15
|
return stdout;
|
|
15
16
|
};
|
|
16
|
-
const
|
|
17
|
+
const inFlight = new Map();
|
|
18
|
+
let forker;
|
|
19
|
+
let forkerUnavailable = false;
|
|
20
|
+
let nextRequestId = 0;
|
|
21
|
+
const settle = (id) => {
|
|
22
|
+
inFlight.delete(id);
|
|
23
|
+
if (inFlight.size === 0) {
|
|
24
|
+
forker?.channel?.unref();
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const forkerFailure = (response, failure) => Object.assign(new Error(failure.message), {
|
|
28
|
+
...(failure.code !== undefined ? { code: failure.code } : {}),
|
|
29
|
+
stdout: response.stdout,
|
|
30
|
+
stderr: response.stderr,
|
|
31
|
+
});
|
|
32
|
+
const forkerModule = new URL("./git-forker.js", import.meta.url);
|
|
33
|
+
const gitForker = () => {
|
|
34
|
+
if (forker !== undefined || forkerUnavailable) {
|
|
35
|
+
return forker;
|
|
36
|
+
}
|
|
37
|
+
if (!existsSync(forkerModule)) {
|
|
38
|
+
forkerUnavailable = true;
|
|
39
|
+
return undefined;
|
|
40
|
+
}
|
|
41
|
+
const started = fork(forkerModule, { execArgv: [], stdio: ["ignore", "ignore", "inherit", "ipc"] });
|
|
42
|
+
started.on("message", (message) => {
|
|
43
|
+
const response = message;
|
|
44
|
+
const waiting = inFlight.get(response.id);
|
|
45
|
+
if (waiting === undefined) {
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
settle(response.id);
|
|
49
|
+
if (response.failure !== undefined) {
|
|
50
|
+
waiting.reject(forkerFailure(response, response.failure));
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
waiting.resolve({ stdout: response.stdout, stderr: response.stderr });
|
|
54
|
+
});
|
|
55
|
+
started.on("exit", () => {
|
|
56
|
+
forker = undefined;
|
|
57
|
+
const orphaned = [...inFlight.values()];
|
|
58
|
+
inFlight.clear();
|
|
59
|
+
for (const waiting of orphaned) {
|
|
60
|
+
waiting.reject(new Error("git forker exited"));
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
started.on("error", () => {
|
|
64
|
+
forkerUnavailable = true;
|
|
65
|
+
});
|
|
66
|
+
started.unref();
|
|
67
|
+
started.channel?.unref();
|
|
68
|
+
forker = started;
|
|
69
|
+
return forker;
|
|
70
|
+
};
|
|
71
|
+
const runGit = (command, args, env) => {
|
|
72
|
+
const resolved = env === undefined ? undefined : { ...process.env, ...env };
|
|
73
|
+
const channel = gitForker();
|
|
74
|
+
if (channel === undefined) {
|
|
75
|
+
return exec(command, [...args], { maxBuffer: MAX_GIT_OUTPUT, ...(resolved !== undefined ? { env: resolved } : {}) });
|
|
76
|
+
}
|
|
77
|
+
const id = nextRequestId;
|
|
78
|
+
nextRequestId += 1;
|
|
79
|
+
const request = { id, command, args, maxBuffer: MAX_GIT_OUTPUT, ...(resolved !== undefined ? { env: resolved } : {}) };
|
|
80
|
+
return new Promise((resolve, reject) => {
|
|
81
|
+
inFlight.set(id, { resolve, reject });
|
|
82
|
+
channel.channel?.ref();
|
|
83
|
+
channel.send(request, (error) => {
|
|
84
|
+
if (error !== null) {
|
|
85
|
+
settle(id);
|
|
86
|
+
reject(error);
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
const gitRunnerVia = (argv) => async (dir, args, env) => {
|
|
17
92
|
const [command, ...rest] = argv;
|
|
18
93
|
for (let attempt = 1;; attempt += 1) {
|
|
19
94
|
try {
|
|
20
|
-
return await
|
|
95
|
+
return await runGit(command, [...rest, ...GIT_GLOBAL_ARGS, "-C", dir, ...args], env);
|
|
21
96
|
}
|
|
22
97
|
catch (error) {
|
|
23
98
|
if (attempt >= RETRY_ATTEMPTS || !isLockContention(error)) {
|
|
@@ -28,13 +103,13 @@ const gitRunnerVia = (argv) => async (dir, args) => {
|
|
|
28
103
|
}
|
|
29
104
|
};
|
|
30
105
|
export const defaultGit = gitRunnerVia(["git"]);
|
|
31
|
-
export const politeGit = async (dir, args) => {
|
|
106
|
+
export const politeGit = async (dir, args, env) => {
|
|
32
107
|
try {
|
|
33
|
-
return await gitRunnerVia(["nice", "-n", "10", "ionice", "-c", "2", "-n", "7", "git"])(dir, args);
|
|
108
|
+
return await gitRunnerVia(["nice", "-n", "10", "ionice", "-c", "2", "-n", "7", "git"])(dir, args, env);
|
|
34
109
|
}
|
|
35
110
|
catch (error) {
|
|
36
111
|
if (error.code === "ENOENT") {
|
|
37
|
-
return defaultGit(dir, args);
|
|
112
|
+
return defaultGit(dir, args, env);
|
|
38
113
|
}
|
|
39
114
|
throw error;
|
|
40
115
|
}
|
package/dist/exec.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.js","sourceRoot":"","sources":["../src/exec.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1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,CAAC,CAAC;QACtC,CAAC;QACD,MAAM,KAAK,CAAC;IAChB,CAAC;AACL,CAAC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface ForkRequest {
|
|
2
|
+
readonly id: number;
|
|
3
|
+
readonly command: string;
|
|
4
|
+
readonly args: readonly string[];
|
|
5
|
+
readonly maxBuffer: number;
|
|
6
|
+
readonly env?: Readonly<Record<string, string | undefined>>;
|
|
7
|
+
}
|
|
8
|
+
export interface ForkResponse {
|
|
9
|
+
readonly id: number;
|
|
10
|
+
readonly stdout: string;
|
|
11
|
+
readonly stderr: string;
|
|
12
|
+
readonly failure?: {
|
|
13
|
+
readonly message: string;
|
|
14
|
+
readonly code?: number | string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=git-forker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-forker.d.ts","sourceRoot":"","sources":["../src/git-forker.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,WAAW;IACxB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAI3B,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CAC/D;AAKD,MAAM,WAAW,YAAY;IACzB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;CACpF"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { execFile } from "node:child_process";
|
|
2
|
+
const send = process.send?.bind(process);
|
|
3
|
+
if (send === undefined) {
|
|
4
|
+
throw new Error("git forker started without an IPC channel");
|
|
5
|
+
}
|
|
6
|
+
process.on("message", (request) => {
|
|
7
|
+
execFile(request.command, [...request.args], { maxBuffer: request.maxBuffer, ...(request.env !== undefined ? { env: request.env } : {}) }, (error, stdout, stderr) => {
|
|
8
|
+
const response = {
|
|
9
|
+
id: request.id,
|
|
10
|
+
stdout,
|
|
11
|
+
stderr,
|
|
12
|
+
...(error === null
|
|
13
|
+
? {}
|
|
14
|
+
: {
|
|
15
|
+
failure: {
|
|
16
|
+
message: error.message,
|
|
17
|
+
...(error.code !== undefined && error.code !== null ? { code: error.code } : {}),
|
|
18
|
+
},
|
|
19
|
+
}),
|
|
20
|
+
};
|
|
21
|
+
send(response);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
process.on("disconnect", () => process.exit(0));
|
|
25
|
+
//# sourceMappingURL=git-forker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-forker.js","sourceRoot":"","sources":["../src/git-forker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAgC9C,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;AACzC,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;IACrB,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;AACjE,CAAC;AAED,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,CAAC,OAAoB,EAAE,EAAE;IAC3C,QAAQ,CACJ,OAAO,CAAC,OAAO,EACf,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,EACjB,EAAE,SAAS,EAAE,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,OAAO,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAC5F,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;QACtB,MAAM,QAAQ,GAAiB;YAC3B,EAAE,EAAE,OAAO,CAAC,EAAE;YACd,MAAM;YACN,MAAM;YAGN,GAAG,CAAC,KAAK,KAAK,IAAI;gBACd,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC;oBACI,OAAO,EAAE;wBACL,OAAO,EAAE,KAAK,CAAC,OAAO;wBACtB,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;qBACnF;iBACJ,CAAC;SACX,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,CAAC;IACnB,CAAC,CACJ,CAAC;AACN,CAAC,CAAC,CAAC;AAGH,OAAO,CAAC,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentic/scaffold",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.167.0",
|
|
4
4
|
"description": "Shared scaffold for an intentic workspace — the intent-repo skeleton + deploy.config managed-region render/parse, used by the CLI's `init` and the sandbox daemon",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"tslib": "2.8.1",
|
|
34
|
-
"@intentic/graph": "1.
|
|
35
|
-
"@intentic/sandbox-contract": "1.
|
|
34
|
+
"@intentic/graph": "1.167.0",
|
|
35
|
+
"@intentic/sandbox-contract": "1.167.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "24.13.2",
|