@ouro.bot/cli 0.1.0-alpha.1615 → 0.1.0-alpha.1617
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/changelog.json +12 -0
- package/deploy/unraid/sanctuary.ouro/bundle-meta.json +1 -1
- package/deploy/unraid/sanctuary.xml +1 -1
- package/dist/eval/interviews/u/kit.js +5 -1
- package/dist/eval/sandbox/docker.js +16 -5
- package/dist/repertoire/guardrails.js +113 -11
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
package/changelog.json
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"_note": "Each pull request writes its own change note under changes/; the release job on main gives each landed change its version and adds the notes here (scripts/release-version.cjs). On main this file stops at the last version set by hand; the published package has every release. Agents read this file directly via read_file to understand what changed between versions.",
|
|
3
3
|
"versions": [
|
|
4
|
+
{
|
|
5
|
+
"version": "0.1.0-alpha.1617",
|
|
6
|
+
"changes": [
|
|
7
|
+
"Blind interviews, product U: every arm's sandbox container now has 4 GB of memory instead of 2 GB. Grading a component built on the shadcn kit peaks at about 2 GB, so at 2 GB it thrashed until the turn's time limit and the arm ended ungraded. A guest can now name its own container memory (`memory`, such as `4g`); the household and helper containers keep 2 GB."
|
|
8
|
+
]
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"version": "0.1.0-alpha.1616",
|
|
12
|
+
"changes": [
|
|
13
|
+
"The shell can no longer write an agent's friends store or product rules. The file tools already refused those writes for everyone. Now a shell command that names either folder runs only when every part of it plainly reads, so an A2A peer can't raise its own trust with `sed -i` ([#1949](https://github.com/ourostack/ouroboros/issues/1949)). The command counts as naming a folder when it does so through a path, a `cd`, the call's `cwd`, `~` or `$HOME`, a glob that could land there, or the home folder handed to `find`, `xargs`, `rm` and the like. The shell's `cwd` now counts for the psyche guard too, and `rm -rf ./psyche*` is refused again. Reads through `jq`, `sort`, and `find` without an action still work."
|
|
14
|
+
]
|
|
15
|
+
},
|
|
4
16
|
{
|
|
5
17
|
"version": "0.1.0-alpha.1615",
|
|
6
18
|
"changes": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<?xml version="1.0"?>
|
|
2
2
|
<Container version="2">
|
|
3
3
|
<Name>ouro-butler</Name>
|
|
4
|
-
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.
|
|
4
|
+
<Repository>ghcr.io/ourostack/ouroboros-butler:0.1.0-alpha.1617</Repository>
|
|
5
5
|
<Registry>https://github.com/ourostack/ouroboros/pkgs/container/ouroboros-butler</Registry>
|
|
6
6
|
<Network>host</Network>
|
|
7
7
|
<Shell>sh</Shell>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.U_KIT = exports.U_IMAGE = exports.U_FIDELITY = exports.U_CASE = exports.U_JOB_MESSAGE = exports.U_JOB = void 0;
|
|
3
|
+
exports.U_KIT = exports.U_IMAGE = exports.U_FIDELITY = exports.U_MEMORY = exports.U_CASE = exports.U_JOB_MESSAGE = exports.U_JOB = void 0;
|
|
4
4
|
exports.readGrade = readGrade;
|
|
5
5
|
exports.gradeU = gradeU;
|
|
6
6
|
/**
|
|
@@ -72,6 +72,8 @@ function gradeU(run) {
|
|
|
72
72
|
(0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.u_graded", message: "graded a U run", meta: { failed: failed.length, escapeHits: hits.length } });
|
|
73
73
|
return { passed: failed.length === 0, reason: failed.length === 0 ? null : `failed ${failed.join(", ")}`, checks };
|
|
74
74
|
}
|
|
75
|
+
/** U's container memory, the same in every arm: grading a component bundled from the shadcn kit needs more than 2g. */
|
|
76
|
+
exports.U_MEMORY = "4g";
|
|
75
77
|
/** What is recorded about each U arm before any session (section 3): where it differs from the kit it stands for. */
|
|
76
78
|
exports.U_FIDELITY = {
|
|
77
79
|
"U:all": [
|
|
@@ -84,6 +86,7 @@ exports.U_FIDELITY = {
|
|
|
84
86
|
"the system prompt is the Butler's persona and the label line, as in every U and X arm",
|
|
85
87
|
"the page runs in jsdom with no-op stand-ins for browser features jsdom lacks (CSS.supports answering false, ResizeObserver, IntersectionObserver, matchMedia never matching, scrollIntoView, pointer capture, getAnimations, dialog show, showModal and close), the same for every arm; the kits' own tests run in real browsers",
|
|
86
88
|
"every word of the brand pattern is rewritten wherever it appears, inside words too (hourOffset becomes hkitffset), in the kit and in node_modules; a scan then finds none left in the template",
|
|
89
|
+
`every arm's container has ${exports.U_MEMORY} of memory, where other guests have 2g: grading the shadcn arm's reference peaks at about 2,058 MiB (ouro's about 802, mui's about 491, sampled once a second), so under 2g it thrashed past the turn's time limit and the U pilot's shadcn arm ended ungraded; the limit is the same in every arm, and the shadcn arm's checks still take longer (about 79 s to grade, against 23 s and 21 s), which the model doesn't see`,
|
|
87
90
|
],
|
|
88
91
|
"U:ouro": [
|
|
89
92
|
"Ouro UI at 45b39c4a632b ships as copy-in source; here its 135 components (each folder's component.json list) and the 280 files they import are one package, @kit/ui, with a barrel of 668 exports, an ES module build and type declarations, without its stylesheet or design tokens",
|
|
@@ -109,6 +112,7 @@ exports.U_KIT = {
|
|
|
109
112
|
turn: { product: session.product, arm: arm.arm, labelLine: (0, protocol_1.labelLine)(session.product, arm.label), prefix: [], userText: exports.U_JOB_MESSAGE, followUps: [debrief] },
|
|
110
113
|
// The U image (deploy/eval/u): the agent image with the three kits' templates and the checking tools.
|
|
111
114
|
image: exports.U_IMAGE,
|
|
115
|
+
memory: exports.U_MEMORY,
|
|
112
116
|
}),
|
|
113
117
|
canonical: (_arm, obs) => obs,
|
|
114
118
|
job: (id) => id === exports.U_JOB ? exports.U_CASE : undefined,
|
|
@@ -60,10 +60,16 @@ exports.BUTLER_CONTAINERS = "^/?ouro-butler(-staging|-rollback)?$";
|
|
|
60
60
|
exports.LIBGEN_MIRRORS = ["libgen.li", "libgen.bz", "libgen.gl", "libgen.la", "libgen.vg"];
|
|
61
61
|
exports.POCKETBOOK_ADDRESS = "pocketbook@example.invalid";
|
|
62
62
|
const ALIASES = ["calibre-web", "smtp", ...exports.LIBGEN_MIRRORS];
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
/** Every container's limits; `memory` is the agent container's when its guest names one (`guest.memory`), 2g otherwise. */
|
|
64
|
+
function hardening(memory = "2g") {
|
|
65
|
+
return [
|
|
66
|
+
"--log-driver", "none", "--read-only", "--cap-drop", "ALL", "--security-opt", "no-new-privileges", "--pids-limit", "512",
|
|
67
|
+
"--memory", memory, "--memory-swap", memory, "--cpus", "2", "--ulimit", `fsize=${readback_1.SNAPSHOT_LIMITS.bytes}`,
|
|
68
|
+
];
|
|
69
|
+
}
|
|
70
|
+
const HARDENING = hardening();
|
|
71
|
+
/** A guest's memory goes to `docker run` as one argument, so it is only ever a whole number of megabytes or gigabytes. */
|
|
72
|
+
const GUEST_MEMORY = /^[1-9]\d*[mg]$/;
|
|
67
73
|
const STDERR_TAIL = 4000;
|
|
68
74
|
function dockerCli(command = "docker") {
|
|
69
75
|
return {
|
|
@@ -217,6 +223,11 @@ async function runSandboxed(input) {
|
|
|
217
223
|
const docker = input.docker ?? dockerCli();
|
|
218
224
|
const images = input.images ?? { agent: exports.SANDBOX_IMAGE, household: exports.HOUSEHOLD_IMAGE };
|
|
219
225
|
const agentImage = (0, images_1.agentImageOf)(images, input.guest?.image);
|
|
226
|
+
const memory = input.guest?.memory;
|
|
227
|
+
if (memory !== undefined && !GUEST_MEMORY.test(memory))
|
|
228
|
+
throw new Error(`a guest's memory is a whole number of m or g, such as 4g, not ${memory}`);
|
|
229
|
+
if (memory !== undefined)
|
|
230
|
+
(0, runtime_1.emitNervesEvent)({ component: "eval", event: "eval.sandbox_guest_memory", message: "the guest's container takes its own memory", meta: { memory } });
|
|
220
231
|
const profile = input.profile ?? (0, agent_profile_1.sanctuaryProfile)({ bundleDir: input.bundleDir, seedBundleDir: input.seedBundleDir });
|
|
221
232
|
(0, agent_profile_1.checkProfile)(profile);
|
|
222
233
|
const runId = `${exports.EVAL_RUN_PREFIX}${node_crypto_1.default.randomBytes(4).toString("hex")}`;
|
|
@@ -295,7 +306,7 @@ async function runSandboxed(input) {
|
|
|
295
306
|
const before = (0, readback_1.snapshotFiles)(bundle, [...profile.writable]);
|
|
296
307
|
started.push(agentName);
|
|
297
308
|
const agent = docker.start([
|
|
298
|
-
"run", "-i", "--rm", "--name", agentName, ...runLabels, "--network", runId, "--user", "10001:10001", ...
|
|
309
|
+
"run", "-i", "--rm", "--name", agentName, ...runLabels, "--network", runId, "--user", "10001:10001", ...hardening(memory),
|
|
299
310
|
"--tmpfs", "/tmp:rw,mode=1777,size=256m", "--tmpfs", "/home/ouro:rw,uid=10001,gid=10001,mode=0700,size=256m", "--env", "HOME=/home/ouro",
|
|
300
311
|
...(0, agent_profile_1.bundleMounts)(profile, bundle),
|
|
301
312
|
"-v", `${tls}/ca.pem:/etc/ssl/certs/ca-certificates.crt:ro`, "-v", `${turnFile}:/eval/turn.json:ro`,
|
|
@@ -42,6 +42,7 @@ exports.psycheEditNote = psycheEditNote;
|
|
|
42
42
|
exports.fileToolPath = fileToolPath;
|
|
43
43
|
exports.guardInvocation = guardInvocation;
|
|
44
44
|
const fs = __importStar(require("node:fs"));
|
|
45
|
+
const os = __importStar(require("node:os"));
|
|
45
46
|
const path = __importStar(require("node:path"));
|
|
46
47
|
const friends_1 = require("@ouro.bot/friends");
|
|
47
48
|
const shell_quote_1 = require("shell-quote");
|
|
@@ -206,8 +207,14 @@ function psycheWriteAllowed(fileClass, _filePath, context) {
|
|
|
206
207
|
// that may not write a psyche file may still read it from the shell: a command that names the psyche runs only when every part
|
|
207
208
|
// of it is a plain read. Commands that never name the psyche are untouched.
|
|
208
209
|
const PSYCHE_SHELL_FILE = /^(?:SOUL|IDENTITY|LORE|ASPIRATIONS|TACIT)\.md$/i;
|
|
209
|
-
const
|
|
210
|
-
|
|
210
|
+
const SHELL_FOLDER_PATHLIKE = {
|
|
211
|
+
psyche: /[\w.~/-]*(?:\/psyche(?:\/[\w.*-]*|(?![\w.-]))|psyche\/[\w.*-]*)/g,
|
|
212
|
+
friends: /[\w.~/-]*(?:\/friends(?:\/[\w.*-]*|(?![\w.-]))|friends\/[\w.*-]*)/g,
|
|
213
|
+
product: /[\w.~/-]*(?:\/product(?:\/[\w.*-]*|(?![\w.-]))|product\/[\w.*-]*)/g,
|
|
214
|
+
};
|
|
215
|
+
const PSYCHE_SHELL_READERS = new Set(["cat", "head", "tail", "grep", "egrep", "fgrep", "rg", "wc", "ls", "stat", "file", "diff", "cmp", "sha256sum", "shasum", "md5sum", "cd", "pwd", "echo", "printf", "true", "jq", "uniq", "cut", "tr", "nl", "column", "tree", "basename", "dirname", "realpath", "readlink", "od", "xxd", "less", "more"]);
|
|
216
|
+
/** find reads unless it runs, deletes or prints into a file. */
|
|
217
|
+
const FIND_ACTIONS = /^-(?:exec|execdir|ok|okdir|delete|fprint|fprint0|fprintf|fls)$/;
|
|
211
218
|
const PSYCHE_SHELL_GIT_READS = new Set(["log", "show", "diff", "status", "blame"]);
|
|
212
219
|
const PSYCHE_SHELL_SEPARATORS = /\s*(?:&&|\|\||[;&|\n])\s*/;
|
|
213
220
|
/** The command's words, split on unquoted whitespace and shell operators, with their quotes removed. */
|
|
@@ -238,6 +245,13 @@ function shellWordsLoosely(command) {
|
|
|
238
245
|
words.push(word);
|
|
239
246
|
return words;
|
|
240
247
|
}
|
|
248
|
+
/** The words in one shell word that could name the agent's `folder`: the bare folder name, or a path through it. */
|
|
249
|
+
function shellFolderCandidates(word, folder) {
|
|
250
|
+
const candidates = new Set(word === folder || word === `./${folder}` ? [word] : []);
|
|
251
|
+
for (const match of word.matchAll(SHELL_FOLDER_PATHLIKE[folder]))
|
|
252
|
+
candidates.add(match[0]);
|
|
253
|
+
return candidates;
|
|
254
|
+
}
|
|
241
255
|
/** Which psyche files the command names: null for none, else whether any of them is an identity file. */
|
|
242
256
|
function shellPsycheTarget(command, agentRoot) {
|
|
243
257
|
let target = null;
|
|
@@ -246,10 +260,7 @@ function shellPsycheTarget(command, agentRoot) {
|
|
|
246
260
|
for (const word of shellWordsLoosely(command)) {
|
|
247
261
|
if (PSYCHE_SHELL_FILE.test(word))
|
|
248
262
|
note(/^TACIT\.md$/i.test(word) ? "tacit" : "identity");
|
|
249
|
-
const
|
|
250
|
-
for (const match of word.matchAll(PSYCHE_SHELL_PATHLIKE))
|
|
251
|
-
candidates.add(match[0]);
|
|
252
|
-
for (const candidate of candidates) {
|
|
263
|
+
for (const candidate of shellFolderCandidates(word, "psyche")) {
|
|
253
264
|
try {
|
|
254
265
|
const fileClass = psycheFileClass(candidate, agentRoot);
|
|
255
266
|
if (fileClass)
|
|
@@ -272,6 +283,10 @@ function shellSegmentOnlyReads(segment) {
|
|
|
272
283
|
const program = words[0]?.split("/").pop() ?? "";
|
|
273
284
|
if (PSYCHE_SHELL_READERS.has(program))
|
|
274
285
|
return true;
|
|
286
|
+
if (program === "find")
|
|
287
|
+
return !words.some((word) => FIND_ACTIONS.test(word));
|
|
288
|
+
if (program === "sort")
|
|
289
|
+
return !words.some((word) => /^-[a-zA-Z]*o/.test(word) || word.startsWith("--output"));
|
|
275
290
|
if (program === "sed")
|
|
276
291
|
return !words.some((word) => /^-[a-zA-Z]*i/.test(word) || word.startsWith("--in-place"));
|
|
277
292
|
if (program === "git") {
|
|
@@ -289,14 +304,96 @@ function shellPsycheRefusal(command, context) {
|
|
|
289
304
|
const fileClass = shellPsycheTarget(command, agentRoot);
|
|
290
305
|
if (!fileClass || psycheWriteAllowed(fileClass, "", context))
|
|
291
306
|
return null;
|
|
307
|
+
if (shellCommandOnlyReads(command))
|
|
308
|
+
return null;
|
|
309
|
+
(0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.psyche_shell_refused", message: "refused a shell command that could write a psyche file this turn may not write", meta: { fileClass, channel: context.channel ?? null } });
|
|
310
|
+
return fileClass === "tacit" && isFriendTurn(context) ? exports.TACIT_REFUSAL : exports.PSYCHE_REFUSAL;
|
|
311
|
+
}
|
|
312
|
+
/** Whether every part of the command plainly reads: no output into a file, no tee and no substitution. */
|
|
313
|
+
function shellCommandOnlyReads(command) {
|
|
292
314
|
// Output into a file (a numbered stream into /dev/null or another stream aside), a substitution or a tee can write.
|
|
293
315
|
const streams = command.replace(/\d>(?:&\d|\s*\/dev\/null)/g, "");
|
|
294
316
|
const writesOut = /(?:^|[^0-9&>])>|&>|>>|\btee\b/.test(streams);
|
|
295
|
-
|
|
296
|
-
|
|
317
|
+
return !writesOut && !SUBSHELL_PATTERN.test(command) && streams.split(PSYCHE_SHELL_SEPARATORS).filter(Boolean).every(shellSegmentOnlyReads);
|
|
318
|
+
}
|
|
319
|
+
// The harness writes the friends store (each friend's trust) and the product rules; the file tools refuse a model's write there
|
|
320
|
+
// for everyone. The shell had no such check, so an A2A peer could ask for `sed -i s/friend/family/ friends/<it>.json` (#1949).
|
|
321
|
+
// A command that names either folder, resolved against the agent's own root, runs only when every part of it plainly reads.
|
|
322
|
+
const SHELL_STORE_FOLDERS = ["friends", "product"];
|
|
323
|
+
/** A word's `~/`, `$HOME/` or `${HOME}/` start, written out as the shell would. */
|
|
324
|
+
function shellHomeExpanded(word) {
|
|
325
|
+
return word.replace(/^(?:~|\$HOME|\$\{HOME\})(?=\/|$)/, os.homedir());
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* A word the shell would expand as a glob: shaped like a path (no spaces, quotes, parentheses, `:` or `=`), with `*`, `?`, a
|
|
329
|
+
* closed `[…]` or a `{a,b}`. Code handed to `node -e` (`{if`, `{length:2}`) isn't one.
|
|
330
|
+
*/
|
|
331
|
+
function isShellGlob(word) {
|
|
332
|
+
return /^[\w.~/*?[\]{},!@+-]+$/u.test(word) && (/[*?]/u.test(word) || /\[[^\]]+\]/u.test(word) || /\{[^}]*,[^}]*\}/u.test(word));
|
|
333
|
+
}
|
|
334
|
+
const SHELL_GLOB = /[*?[{]/;
|
|
335
|
+
/** Programs that change files in every folder they're given, so naming the agent's home with one reaches the store too. */
|
|
336
|
+
const SHELL_RECURSIVE_WRITERS = new Set(["find", "xargs", "rm", "mv", "cp", "rsync", "chmod", "chown", "sed", "perl", "tar", "install", "ln", "truncate", "touch"]);
|
|
337
|
+
/** Whether the absolute `dir` is the agent's home or a folder above it, from which a glob or a recursive program reaches `folder`. */
|
|
338
|
+
function holdsAgentFolder(dir, agentRoot) {
|
|
339
|
+
const roots = [path.resolve(agentRoot), canonicalize(path.resolve(agentRoot))];
|
|
340
|
+
return [dir, canonicalize(dir)].some((target) => roots.some((root) => root === target || root.startsWith(`${target === path.sep ? "" : target}${path.sep}`)));
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Whether the command names the agent's own `folder`: as a path through it, as a glob that could land in it, or as the home
|
|
344
|
+
* that holds it given to a program that changes whole folders (`find . -delete`, `xargs sed -i`). A path whose landing place
|
|
345
|
+
* can't be read counts as naming it. The bare word is also an English one ("my friends are kind"), so echo and printf's words
|
|
346
|
+
* and a git message name it only as a path.
|
|
347
|
+
*/
|
|
348
|
+
function shellNamesAgentFolder(command, agentRoot, folder) {
|
|
349
|
+
const segments = command.split(PSYCHE_SHELL_SEPARATORS).map(shellWordsLoosely);
|
|
350
|
+
const piped = segments.some((words) => programOf(words) === "xargs");
|
|
351
|
+
// Relative words start where the command is: the agent's home, then wherever a cd moved it.
|
|
352
|
+
let base = agentRoot;
|
|
353
|
+
return segments.some((words) => {
|
|
354
|
+
const program = programOf(words);
|
|
355
|
+
const prose = program === "echo" || program === "printf";
|
|
356
|
+
const wholeFolders = piped || SHELL_RECURSIVE_WRITERS.has(program);
|
|
357
|
+
const named = words.some((raw, index) => {
|
|
358
|
+
if (program === "git" && /^(?:-m|--message|-F|--file)$/.test(words[index - 1] ?? ""))
|
|
359
|
+
return false;
|
|
360
|
+
const word = shellHomeExpanded(raw);
|
|
361
|
+
try {
|
|
362
|
+
if (!prose && isShellGlob(word)) {
|
|
363
|
+
// The folder the glob starts in, before its first wildcard segment.
|
|
364
|
+
const parts = word.split("/");
|
|
365
|
+
const literal = parts.slice(0, parts.findIndex((part) => SHELL_GLOB.test(part))).join("/");
|
|
366
|
+
const start = path.resolve(base, word.startsWith("/") && literal === "" ? "/" : literal || ".");
|
|
367
|
+
if (holdsAgentFolder(start, agentRoot) || insideAgentFolder(start, agentRoot, folder))
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
if (wholeFolders && index > 0 && !raw.startsWith("-") && holdsAgentFolder(path.resolve(base, word), agentRoot))
|
|
371
|
+
return true;
|
|
372
|
+
return [...shellFolderCandidates(word, folder)].some((candidate) => (!prose || candidate.includes("/")) && insideAgentFolder(path.resolve(base, candidate), agentRoot, folder));
|
|
373
|
+
}
|
|
374
|
+
catch {
|
|
375
|
+
return true;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
if (program === "cd" && words[1] !== undefined)
|
|
379
|
+
base = path.resolve(base, shellHomeExpanded(words[1]));
|
|
380
|
+
return named;
|
|
381
|
+
});
|
|
382
|
+
}
|
|
383
|
+
/** The program a simple command runs: its first word after any leading assignments, without its folder. */
|
|
384
|
+
function programOf(words) {
|
|
385
|
+
return words.find((word) => !/^[A-Za-z_][A-Za-z0-9_]*=/.test(word))?.split("/").pop() ?? "";
|
|
386
|
+
}
|
|
387
|
+
/** The refusal for a shell command that could write the friends store or the product rules, or null. */
|
|
388
|
+
function shellStoreRefusal(command, context) {
|
|
389
|
+
const agentRoot = context.agentRoot;
|
|
390
|
+
if (!agentRoot)
|
|
297
391
|
return null;
|
|
298
|
-
|
|
299
|
-
|
|
392
|
+
const folder = SHELL_STORE_FOLDERS.find((name) => fs.existsSync(path.join(agentRoot, name)) && shellNamesAgentFolder(command, agentRoot, name));
|
|
393
|
+
if (!folder || shellCommandOnlyReads(command))
|
|
394
|
+
return null;
|
|
395
|
+
(0, runtime_1.emitNervesEvent)({ component: "repertoire", event: "repertoire.store_shell_refused", message: "refused a shell command that could write the friends store or the product rules", meta: { folder, channel: context.channel ?? null } });
|
|
396
|
+
return REASONS.protectedPath;
|
|
300
397
|
}
|
|
301
398
|
/** A turn that carries a person who is not family: TACIT is read-only to it. */
|
|
302
399
|
function isFriendTurn(context) {
|
|
@@ -367,9 +464,14 @@ function checkProtectedPaths(toolName, args, context) {
|
|
|
367
464
|
return deny(REASONS.unreadablePath);
|
|
368
465
|
if (shellWritesToProtectedPath(command))
|
|
369
466
|
return deny(REASONS.protectedPath);
|
|
370
|
-
|
|
467
|
+
// A cwd is where the command runs, so it is read as a cd in front of it: `sed -i` with cwd friends names the store.
|
|
468
|
+
const placed = typeof args.cwd === "string" && args.cwd !== "" ? `cd '${args.cwd.replaceAll("'", "")}' && ${command}` : command;
|
|
469
|
+
const psycheRefusal = shellPsycheRefusal(placed, context);
|
|
371
470
|
if (psycheRefusal)
|
|
372
471
|
return deny(psycheRefusal);
|
|
472
|
+
const storeRefusal = shellStoreRefusal(placed, context);
|
|
473
|
+
if (storeRefusal)
|
|
474
|
+
return deny(storeRefusal);
|
|
373
475
|
}
|
|
374
476
|
return allow;
|
|
375
477
|
}
|
package/npm-shrinkwrap.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1617",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@ouro.bot/cli",
|
|
9
|
-
"version": "0.1.0-alpha.
|
|
9
|
+
"version": "0.1.0-alpha.1617",
|
|
10
10
|
"bundleDependencies": [
|
|
11
11
|
"@ouro.bot/friends"
|
|
12
12
|
],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ouro.bot/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.1617",
|
|
4
4
|
"description": "Ouroboros, the agent harness: agents with durable memory that live where you talk (terminal, Teams, iMessage, mail, voice) and use real tools. Start with npx ouro.bot@latest.",
|
|
5
5
|
"homepage": "https://ouroboros.bot/",
|
|
6
6
|
"engines": {
|