mirror of
https://github.com/ruvnet/RuView
synced 2026-07-31 18:51:42 +00:00
feat(ruview): secure community metaharness flywheel (#1467)
* feat(ruview): add secure community metaharness flywheel * fix(ruview): canonicalize manifest line endings
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
import { runProcess } from '../process-runner.js';
|
||||
import { assertTrustedRuViewRepo } from '../repo-trust.js';
|
||||
export function buildCodexArgs(root, { write = false } = {}) {
|
||||
return ['exec', '-', '-C', root, '--sandbox', write ? 'workspace-write' : 'read-only',
|
||||
'--ephemeral', '--json', '--strict-config', '--ignore-user-config', '--ignore-rules'];
|
||||
}
|
||||
export async function runCodex({
|
||||
prompt, repoRoot, trustedRoot = repoRoot, allowWrite = false, confirm = false,
|
||||
command = 'codex', commandArgs = [], ...runOptions
|
||||
}) {
|
||||
if (typeof prompt !== 'string' || !prompt.trim()) throw new TypeError('prompt must be a non-empty string');
|
||||
const root = assertTrustedRuViewRepo(repoRoot, { trustedRoot });
|
||||
const write = allowWrite === true && confirm === true;
|
||||
return runProcess(command, [...commandArgs, ...buildCodexArgs(root, { write })], { ...runOptions, cwd: root, input: prompt });
|
||||
}
|
||||
export default Object.freeze({ name: 'codex', run: runCodex, buildArgs: buildCodexArgs });
|
||||
Reference in New Issue
Block a user