@kingsoftcloud/agentkit-harness-node 0.0.1 → 0.0.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kingsoftcloud/agentkit-harness-node",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Standalone Native Harness Node adapters: a durable SQLite run store, a one-request model HTTP port, and a minimal versioned JSON-RPC 2.0 over NDJSON process entry. Reuses the shared Native adapter implementations and externalizes @kingsoftcloud/agentkit-harness-core; depends on no Studio/DSH code at runtime.",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"THIRD_PARTY_NOTICES.md"
|
|
136
136
|
],
|
|
137
137
|
"dependencies": {
|
|
138
|
-
"@kingsoftcloud/agentkit-harness-core": "0.0.
|
|
138
|
+
"@kingsoftcloud/agentkit-harness-core": "0.0.3",
|
|
139
139
|
"@astral-sh/ruff-wasm-nodejs": "0.16.8",
|
|
140
140
|
"parse5": "7.3.0",
|
|
141
141
|
"playwright-core": "1.58.2",
|
|
@@ -38,21 +38,26 @@ export function privateDirectory(path, create = false) {
|
|
|
38
38
|
export function privateFile(path, allowMissing = false) {
|
|
39
39
|
try {
|
|
40
40
|
const stat = lstatSync(path);
|
|
41
|
-
check(stat.isFile() && stat.
|
|
41
|
+
check(stat.isFile() && stat.uid === process.getuid() && (stat.mode & 0o077) === 0,
|
|
42
42
|
'background_state_not_private');
|
|
43
|
+
// Atomic publication can unlink the inode while lstat is observing it.
|
|
44
|
+
// It is never usable evidence; read-only callers may retry the new inode.
|
|
45
|
+
check(stat.nlink !== 0, 'background_state_changed');
|
|
46
|
+
check(stat.nlink === 1, 'background_state_not_private');
|
|
43
47
|
return stat;
|
|
44
48
|
} catch (error) { if (allowMissing && error.code === 'ENOENT') return null; throw error; }
|
|
45
49
|
}
|
|
46
50
|
export function openPrivate(path, flags) {
|
|
47
51
|
for (let attempt = 0; ; attempt++) {
|
|
48
|
-
|
|
49
|
-
const fd = openSync(path, flags | constants.O_NOFOLLOW | constants.O_NONBLOCK, 0o600);
|
|
52
|
+
let fd;
|
|
50
53
|
try {
|
|
54
|
+
privateDirectory(dirname(path)); privateFile(path, true);
|
|
55
|
+
fd = openSync(path, flags | constants.O_NOFOLLOW | constants.O_NONBLOCK, 0o600);
|
|
51
56
|
const stat = fstatSync(fd), current = privateFile(path);
|
|
52
57
|
check(stat.isFile() && stat.dev === current.dev && stat.ino === current.ino, 'background_state_changed');
|
|
53
58
|
return fd;
|
|
54
59
|
} catch (error) {
|
|
55
|
-
closeSync(fd);
|
|
60
|
+
if (fd !== undefined) closeSync(fd);
|
|
56
61
|
// The supervisor atomically replaces outputs and records. A read opened
|
|
57
62
|
// across that publication must retry the newly verified private inode.
|
|
58
63
|
// Never retry writes, unsafe permissions/links, or persistent churn.
|