@bjoernrochel/sevro 0.1.0-rc.21 → 0.1.0-rc.22
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/docs/installing.md +2 -2
- package/package.json +1 -1
- package/src/hosts/codex-state.ts +20 -0
package/docs/installing.md
CHANGED
|
@@ -23,10 +23,10 @@ Local installation records the selected version in the project lockfile.
|
|
|
23
23
|
|
|
24
24
|
## Current release
|
|
25
25
|
|
|
26
|
-
The current release is `0.1.0-rc.
|
|
26
|
+
The current release is `0.1.0-rc.22`. Install this exact version:
|
|
27
27
|
|
|
28
28
|
```sh
|
|
29
|
-
bun add --exact @bjoernrochel/sevro@0.1.0-rc.
|
|
29
|
+
bun add --exact @bjoernrochel/sevro@0.1.0-rc.22
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
<!-- sevro-current-release:end -->
|
package/package.json
CHANGED
package/src/hosts/codex-state.ts
CHANGED
|
@@ -28,6 +28,7 @@ import {
|
|
|
28
28
|
candidateTranscriptRoots,
|
|
29
29
|
} from "../native-transcripts";
|
|
30
30
|
import { prepareHookMounts } from "../runtime/hooks";
|
|
31
|
+
import { requireNativeHookRoots } from "../native-transcript-state";
|
|
31
32
|
import {
|
|
32
33
|
requireRuntimeReadRoots,
|
|
33
34
|
runtimeExecutableProtection,
|
|
@@ -102,9 +103,28 @@ export async function codexHookMounts(
|
|
|
102
103
|
await rm(root, { recursive: true });
|
|
103
104
|
await cp(curated, root, { recursive: true });
|
|
104
105
|
}
|
|
106
|
+
await grantCodexHookReads(state, hooks.directories);
|
|
105
107
|
return hooks;
|
|
106
108
|
}
|
|
107
109
|
|
|
110
|
+
/** Hooks advertise paths relative to these curated copies, not the install cache. */
|
|
111
|
+
async function grantCodexHookReads(
|
|
112
|
+
state: CodexState,
|
|
113
|
+
roots: string[],
|
|
114
|
+
): Promise<void> {
|
|
115
|
+
if (roots.length === 0) return;
|
|
116
|
+
await requireNativeHookRoots(roots, state.codexHome);
|
|
117
|
+
const path = join(state.codexHome, "config.toml");
|
|
118
|
+
const config = await readFile(path, "utf8");
|
|
119
|
+
const header = `[permissions.${state.profileId}.filesystem]\n`;
|
|
120
|
+
const grants = roots
|
|
121
|
+
.map((root) => `${JSON.stringify(root)} = "read"\n`)
|
|
122
|
+
.join("");
|
|
123
|
+
await writeFile(path, config.replace(header, header + grants), {
|
|
124
|
+
mode: 0o600,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
|
|
108
128
|
async function privateCodexDirectories(stateRoot: string) {
|
|
109
129
|
const codexHome = join(stateRoot, "codex-home"),
|
|
110
130
|
parentHome = join(stateRoot, "home"),
|