@xrkseek/harness 0.5.12 → 0.5.13
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/node_modules/@vscode/ripgrep/LICENSE +13 -0
- package/node_modules/@vscode/ripgrep/README.md +33 -0
- package/node_modules/@vscode/ripgrep/lib/index.d.ts +1 -0
- package/node_modules/@vscode/ripgrep/lib/index.js +19 -0
- package/node_modules/@vscode/ripgrep/package.json +39 -0
- package/node_modules/@vscode/ripgrep-win32-x64/LICENSE +13 -0
- package/node_modules/@vscode/ripgrep-win32-x64/README.md +5 -0
- package/node_modules/@vscode/ripgrep-win32-x64/bin/rg.exe +0 -0
- package/node_modules/@vscode/ripgrep-win32-x64/package.json +19 -0
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts +7 -9
- package/node_modules/@xrkseek/exec-fs/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/index.js +60 -19
- package/node_modules/@xrkseek/exec-fs/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/ripgrep.d.ts +63 -0
- package/node_modules/@xrkseek/exec-fs/dist/ripgrep.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/ripgrep.js +363 -0
- package/node_modules/@xrkseek/exec-fs/dist/ripgrep.js.map +1 -0
- package/node_modules/@xrkseek/exec-fs/dist/search.d.ts +32 -3
- package/node_modules/@xrkseek/exec-fs/dist/search.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-fs/dist/search.js +189 -72
- package/node_modules/@xrkseek/exec-fs/dist/search.js.map +1 -1
- package/node_modules/@xrkseek/exec-fs/package.json +2 -0
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts +14 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js +37 -5
- package/node_modules/@xrkseek/exec-shell/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-subprocess/dist/capture.d.ts +73 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/capture.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/capture.js +240 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/capture.js.map +1 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/index.d.ts +19 -0
- package/node_modules/@xrkseek/exec-subprocess/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-subprocess/dist/index.js +58 -21
- package/node_modules/@xrkseek/exec-subprocess/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +6 -7
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +14 -11
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-harness/package.json +1 -0
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/server-config/dist/home.d.ts +1 -2
- package/node_modules/@xrkseek/server-config/dist/home.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-config/dist/home.js +1 -2
- package/node_modules/@xrkseek/server-config/dist/home.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/face-schema.js +12 -2
- package/node_modules/@xrkseek/server-face/dist/face-schema.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts +11 -0
- package/node_modules/@xrkseek/server-face/dist/session-status.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-status.js +32 -7
- package/node_modules/@xrkseek/server-face/dist/session-status.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +9 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/ws-send-queue.d.ts +10 -0
- package/node_modules/@xrkseek/server-face/dist/ws-send-queue.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/ws-send-queue.js +68 -3
- package/node_modules/@xrkseek/server-face/dist/ws-send-queue.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +7 -8
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +22 -27
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.d.ts +1 -1
- package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.d.ts.map +1 -1
- package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.js +23 -1
- package/node_modules/@xrkseek/xrk-file-reference-local/dist/search.js.map +1 -1
- package/package.json +5 -1
|
@@ -3,14 +3,40 @@
|
|
|
3
3
|
* Caps pending frames / bytes; over budget drops the new frame (peer stays
|
|
4
4
|
* up). Write failure closes the queue. Mirrors DSH “release window” pacing
|
|
5
5
|
* without per-byte window counters — see docs/host-face.md.
|
|
6
|
+
*
|
|
7
|
+
* Frames that carry a `sessionId` (top-level or `payload.sessionId` on the
|
|
8
|
+
* `server-request` envelope) sit in per-session lanes and drain round-robin
|
|
9
|
+
* so one session's burst cannot stall every other live stream on the socket.
|
|
6
10
|
*/
|
|
7
11
|
/** Soft ceiling on queued frames per socket (not yet acked by `send` cb). */
|
|
8
12
|
export const WS_SEND_QUEUE_MAX_FRAMES = 2_048;
|
|
9
13
|
/** Soft ceiling on queued UTF-8 bytes per socket. */
|
|
10
14
|
export const WS_SEND_QUEUE_MAX_BYTES = 32 * 1024 * 1024;
|
|
15
|
+
const SHARED_LANE = "";
|
|
16
|
+
/**
|
|
17
|
+
* Lane key for fair mux/host writes. Session-scoped frames isolate; host-wide
|
|
18
|
+
* frames (no sessionId) share one lane and still participate in round-robin.
|
|
19
|
+
*/
|
|
20
|
+
export function muxSendLaneKey(payload) {
|
|
21
|
+
if (!payload || typeof payload !== "object")
|
|
22
|
+
return SHARED_LANE;
|
|
23
|
+
const rec = payload;
|
|
24
|
+
if (typeof rec.sessionId === "string" && rec.sessionId.length > 0) {
|
|
25
|
+
return rec.sessionId;
|
|
26
|
+
}
|
|
27
|
+
const inner = rec.payload;
|
|
28
|
+
if (inner && typeof inner === "object") {
|
|
29
|
+
const nested = inner;
|
|
30
|
+
if (typeof nested.sessionId === "string" && nested.sessionId.length > 0) {
|
|
31
|
+
return nested.sessionId;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return SHARED_LANE;
|
|
35
|
+
}
|
|
11
36
|
/**
|
|
12
37
|
* Queue JSON frames onto one socket. Later frames wait until `send`'s
|
|
13
38
|
* callback fires. Over-budget frames are dropped; write errors stop enqueue.
|
|
39
|
+
* Session lanes interleave; order within a lane is FIFO.
|
|
14
40
|
*/
|
|
15
41
|
export function createWsSendQueue(socket, options) {
|
|
16
42
|
const maxFrames = options?.maxPendingFrames ?? WS_SEND_QUEUE_MAX_FRAMES;
|
|
@@ -20,6 +46,43 @@ export function createWsSendQueue(socket, options) {
|
|
|
20
46
|
let pendingBytes = 0;
|
|
21
47
|
let closed = false;
|
|
22
48
|
let dropWarned = false;
|
|
49
|
+
const lanes = new Map();
|
|
50
|
+
const order = [];
|
|
51
|
+
let cursor = 0;
|
|
52
|
+
const enqueueLane = (lane, frame) => {
|
|
53
|
+
let q = lanes.get(lane);
|
|
54
|
+
if (!q) {
|
|
55
|
+
q = [];
|
|
56
|
+
lanes.set(lane, q);
|
|
57
|
+
order.push(lane);
|
|
58
|
+
}
|
|
59
|
+
q.push(frame);
|
|
60
|
+
};
|
|
61
|
+
const takeNext = () => {
|
|
62
|
+
const n = order.length;
|
|
63
|
+
if (n === 0)
|
|
64
|
+
return undefined;
|
|
65
|
+
for (let i = 0; i < n; i += 1) {
|
|
66
|
+
const idx = (cursor + i) % n;
|
|
67
|
+
const key = order[idx];
|
|
68
|
+
if (key === undefined)
|
|
69
|
+
continue;
|
|
70
|
+
const q = lanes.get(key);
|
|
71
|
+
if (!q || q.length === 0)
|
|
72
|
+
continue;
|
|
73
|
+
const item = q.shift();
|
|
74
|
+
if (q.length === 0) {
|
|
75
|
+
lanes.delete(key);
|
|
76
|
+
order.splice(idx, 1);
|
|
77
|
+
cursor = order.length === 0 ? 0 : idx % order.length;
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
cursor = (idx + 1) % order.length;
|
|
81
|
+
}
|
|
82
|
+
return item;
|
|
83
|
+
}
|
|
84
|
+
return undefined;
|
|
85
|
+
};
|
|
23
86
|
return {
|
|
24
87
|
sendJson(payload) {
|
|
25
88
|
if (closed || socket.readyState !== socket.OPEN)
|
|
@@ -41,18 +104,20 @@ export function createWsSendQueue(socket, options) {
|
|
|
41
104
|
}
|
|
42
105
|
pendingFrames += 1;
|
|
43
106
|
pendingBytes += bytes;
|
|
107
|
+
enqueueLane(muxSendLaneKey(payload), { text, bytes });
|
|
44
108
|
writes = writes
|
|
45
109
|
.then(() => new Promise((resolve) => {
|
|
110
|
+
const item = takeNext();
|
|
46
111
|
const release = () => {
|
|
47
112
|
pendingFrames = Math.max(0, pendingFrames - 1);
|
|
48
|
-
pendingBytes = Math.max(0, pendingBytes - bytes);
|
|
113
|
+
pendingBytes = Math.max(0, pendingBytes - (item?.bytes ?? bytes));
|
|
49
114
|
resolve();
|
|
50
115
|
};
|
|
51
|
-
if (closed || socket.readyState !== socket.OPEN) {
|
|
116
|
+
if (!item || closed || socket.readyState !== socket.OPEN) {
|
|
52
117
|
release();
|
|
53
118
|
return;
|
|
54
119
|
}
|
|
55
|
-
socket.send(text, (error) => {
|
|
120
|
+
socket.send(item.text, (error) => {
|
|
56
121
|
if (error)
|
|
57
122
|
closed = true;
|
|
58
123
|
release();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-send-queue.js","sourceRoot":"","sources":["../src/ws-send-queue.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ws-send-queue.js","sourceRoot":"","sources":["../src/ws-send-queue.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,6EAA6E;AAC7E,MAAM,CAAC,MAAM,wBAAwB,GAAG,KAAK,CAAC;AAC9C,qDAAqD;AACrD,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAcxD,MAAM,WAAW,GAAG,EAAE,CAAC;AAEvB;;;GAGG;AACH,MAAM,UAAU,cAAc,CAAC,OAAgB;IAC7C,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,WAAW,CAAC;IAChE,MAAM,GAAG,GAAG,OAAkC,CAAC;IAC/C,IAAI,OAAO,GAAG,CAAC,SAAS,KAAK,QAAQ,IAAI,GAAG,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClE,OAAO,GAAG,CAAC,SAAS,CAAC;IACvB,CAAC;IACD,MAAM,KAAK,GAAG,GAAG,CAAC,OAAO,CAAC;IAC1B,IAAI,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,KAAgC,CAAC;QAChD,IAAI,OAAO,MAAM,CAAC,SAAS,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACxE,OAAO,MAAM,CAAC,SAAS,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAID;;;;GAIG;AACH,MAAM,UAAU,iBAAiB,CAC/B,MAAsB,EACtB,OAA4B;IAI5B,MAAM,SAAS,GAAG,OAAO,EAAE,gBAAgB,IAAI,wBAAwB,CAAC;IACxE,MAAM,QA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,aAAa,IAAI,CAAC,CAAC;YACnB,YAAY,IAAI,KAAK,CAAC;YACtB,WAAW,CAAC,cAAc,CAAC,OAAO,CAAC,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;YACtD,MAAM,GAAG,MAAM;iBACZ,IAAI,CACH,GAAG,EAAE,CACH,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,EAAE;gBAC5B,MAAM,IAAI,GAAG,QAAQ,EAAE,CAAC;gBACxB,MAAM,OAAO,GAAG,GAAS,EAAE;oBACzB,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,aAAa,GAAG,CAAC,CAAC,CAAC;oBAC/C,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,YAAY,GAAG,CAAC,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC;oBAClE,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC;gBACF,IAAI,CAAC,IAAI,IAAI,MAAM,IAAI,MAAM,CAAC,UAAU,KAAK,MAAM,CAAC,IAAI,EAAE,CAAC;oBACzD,OAAO,EAAE,CAAC;oBACV,OAAO;gBACT,CAAC;gBACD,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,EAAE,EAAE;oBAC/B,IAAI,KAAK;wBAAE,MAAM,GAAG,IAAI,CAAC;oBACzB,OAAO,EAAE,CAAC;gBACZ,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CACL;iBACA,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;QAC5B,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -65,18 +65,17 @@ export type AgentFactory = (input: {
|
|
|
65
65
|
/** Shared attachment store for tools + vision. */
|
|
66
66
|
attachments?: import("@xrkseek/attachment").AttachmentStore;
|
|
67
67
|
/**
|
|
68
|
-
* Extra absolute roots the model may `read_file`.
|
|
69
|
-
*
|
|
70
|
-
*
|
|
68
|
+
* Extra absolute roots the model may `read_file` / `stat`.
|
|
69
|
+
* Host default: product home (`{XRK_HOME}` — covers attachments, spill,
|
|
70
|
+
* memories). Symlink escape out of a listed root is denied.
|
|
71
71
|
*/
|
|
72
72
|
hostReadableRoots?: readonly string[];
|
|
73
73
|
/**
|
|
74
74
|
* Extra absolute roots the file tools may WRITE by absolute path, in
|
|
75
|
-
* addition to the workspace root.
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
* and relative paths always resolve under the workspace root.
|
|
75
|
+
* addition to the workspace root. Host fills this from Settings
|
|
76
|
+
* `permission.extraWritableRoots` (default includes `{XRK_HOME}`).
|
|
77
|
+
* Symlink escape out of a listed root is denied; relative paths always
|
|
78
|
+
* resolve under the workspace root.
|
|
80
79
|
*/
|
|
81
80
|
extraWritableRoots?: readonly string[];
|
|
82
81
|
/** Live route image gate for `read_image`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAkB,MAAM,qBAAqB,CAAC;AACvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAQL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAS/B,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAKL,KAAK,UAAU,EAChB,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B;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,CACH,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,YAAY,CAAC,CAAC;IACzB,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAAC;IAC1C,IAAI,IAAI,SAAS,YAAY,EAAE,CAAC;IAChC,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B;AAqBD,wBAAgB,iBAAiB,IAAI,WAAW,CAg6E/C"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createLocalAttachmentStore
|
|
1
|
+
import { createLocalAttachmentStore } from "@xrkseek/attachment-local";
|
|
2
2
|
import { createMemorySessionStore, createPersistentSessionStore, createSessionDrainHub, newSession, readSessionEvents, SessionsDirInUseError, } from "@xrkseek/core-session";
|
|
3
3
|
import { createProviderRegistry } from "@xrkseek/llm-registry";
|
|
4
4
|
import { loadPolicyRulesetFile } from "@xrkseek/policy";
|
|
@@ -7,7 +7,7 @@ import { effectiveApprovalPolicy, effectiveSandboxMode, shouldConfineSandbox, }
|
|
|
7
7
|
import { runCuratedMemoryConsolidate, resolveMemoryProvider, } from "@xrkseek/exec-memory";
|
|
8
8
|
import { runSkillCurator } from "@xrkseek/workspace";
|
|
9
9
|
import { resolveSecretStore } from "@xrkseek/secrets";
|
|
10
|
-
import { hostSettingsPath, defaultSpillDir, resolveXrkHome } from "@xrkseek/server-config";
|
|
10
|
+
import { hostSettingsPath, defaultSpillDir, expandHomePath, resolveXrkHome, } from "@xrkseek/server-config";
|
|
11
11
|
import { installOutboundHttpProxy } from "./http-proxy.js";
|
|
12
12
|
import { mountInvariantsFailFast } from "./invariants-fail-fast.js";
|
|
13
13
|
import { watchPolicyFile } from "./policy-file-watch.js";
|
|
@@ -358,7 +358,6 @@ export function createHostManager() {
|
|
|
358
358
|
const attachments = createLocalAttachmentStore({
|
|
359
359
|
xrkHome: resolveXrkHome(),
|
|
360
360
|
});
|
|
361
|
-
const attachmentsRoot = resolveLocalAttachmentsRoot(resolveXrkHome());
|
|
362
361
|
/** Filled after Face boot — MCP image gate reads live Registry modalities. */
|
|
363
362
|
const faceForModality = {};
|
|
364
363
|
const mcpImageAdmission = {
|
|
@@ -534,7 +533,7 @@ export function createHostManager() {
|
|
|
534
533
|
.filter((entry) => typeof entry === "string")
|
|
535
534
|
.map((entry) => entry.trim())
|
|
536
535
|
.filter((entry) => entry !== "")
|
|
537
|
-
.map((entry) => path.resolve(entry));
|
|
536
|
+
.map((entry) => path.resolve(expandHomePath(entry)));
|
|
538
537
|
// Deduplicate while preserving user-declared order (cosmetic).
|
|
539
538
|
return [...new Set(cleaned)];
|
|
540
539
|
};
|
|
@@ -553,6 +552,8 @@ export function createHostManager() {
|
|
|
553
552
|
? envWorld.subprocess
|
|
554
553
|
: createLocalSubprocess(),
|
|
555
554
|
defaultCwd: config.runtime.workspaceRoot,
|
|
555
|
+
// Same dir as hostReadableRoots — job_output spill paths are tool-readable.
|
|
556
|
+
spillDir: defaultSpillDir(),
|
|
556
557
|
// Host-wide shared registry — sandbox confine resolves lazily so
|
|
557
558
|
// Face settings + per-session sandboxMode are read at spawn time,
|
|
558
559
|
// not at shell creation (faceBox.runtime arrives later). This is
|
|
@@ -566,10 +567,12 @@ export function createHostManager() {
|
|
|
566
567
|
return undefined;
|
|
567
568
|
return rt.settingsNamespaces.view("sandbox").value;
|
|
568
569
|
},
|
|
569
|
-
//
|
|
570
|
-
//
|
|
571
|
-
|
|
572
|
-
|
|
570
|
+
// Same allowlist as fs tools (Settings base / Host fallback
|
|
571
|
+
// includes product home) so bash cwd may enter those roots.
|
|
572
|
+
readExtraWritableRoots: () => {
|
|
573
|
+
const roots = readPermissionExtraWritableRoots();
|
|
574
|
+
return roots.length > 0 ? roots : [resolveXrkHome()];
|
|
575
|
+
},
|
|
573
576
|
readSandboxMode: (sessionId) => effectiveSandboxMode(sessionId
|
|
574
577
|
? readSessionEvents(store, sessionId)
|
|
575
578
|
: []),
|
|
@@ -706,13 +709,15 @@ export function createHostManager() {
|
|
|
706
709
|
config.runtime.preset;
|
|
707
710
|
const wsId = faceRuntime.workspaces.workspaceIdOf(sessionId);
|
|
708
711
|
const wsRow = wsId ? faceRuntime.workspaces.get(wsId) : undefined;
|
|
709
|
-
//
|
|
710
|
-
//
|
|
711
|
-
//
|
|
712
|
-
//
|
|
713
|
-
//
|
|
714
|
-
// deployment configured roots here.
|
|
712
|
+
// Settings `permission.extraWritableRoots` (schema base includes
|
|
713
|
+
// product home). Re-read live so the next agent resolve picks up
|
|
714
|
+
// changes; agentCache keys on sessionId so a bound agent keeps its
|
|
715
|
+
// composition until invalidated. Empty → fall back to `{XRK_HOME}`
|
|
716
|
+
// (same default as Settings base / harness composition).
|
|
715
717
|
const permissionExtraWritableRoots = readPermissionExtraWritableRoots();
|
|
718
|
+
const extraWritableRoots = permissionExtraWritableRoots.length > 0
|
|
719
|
+
? permissionExtraWritableRoots
|
|
720
|
+
: [resolveXrkHome()];
|
|
716
721
|
return agentCache.resolve(sessionId, async () => {
|
|
717
722
|
const pluginSettings = pluginSettingsBox.read?.() ?? {};
|
|
718
723
|
const agent = await factory({
|
|
@@ -737,19 +742,9 @@ export function createHostManager() {
|
|
|
737
742
|
: {}),
|
|
738
743
|
plugins: loader.list(),
|
|
739
744
|
attachments,
|
|
740
|
-
//
|
|
741
|
-
hostReadableRoots: [
|
|
742
|
-
|
|
743
|
-
defaultSpillDir(),
|
|
744
|
-
],
|
|
745
|
-
// Wider write surface is a per-deployment setting, not something
|
|
746
|
-
// any preset implies: the `permission` namespace carries an
|
|
747
|
-
// explicit allowlist (extraWritableRoots) that only a
|
|
748
|
-
// permission-aware composition opts into. Absent the setting, the
|
|
749
|
-
// array is empty and file writes stay workspace-bound.
|
|
750
|
-
...(permissionExtraWritableRoots.length
|
|
751
|
-
? { extraWritableRoots: permissionExtraWritableRoots }
|
|
752
|
-
: {}),
|
|
745
|
+
// Existing fs options — product home covers spill / attachments / memories.
|
|
746
|
+
hostReadableRoots: [resolveXrkHome()],
|
|
747
|
+
extraWritableRoots,
|
|
753
748
|
routeAllowsImage: () => faceForModality.current
|
|
754
749
|
? liveRouteAllowsImageInput(faceForModality.current, sessionId)
|
|
755
750
|
: false,
|