fix(tools)!: simplify direct invocation and harden boundary contracts (#555)

Remove REA permission grants, scope ceilings, approval confirmations, and inert settings. Preserve selected local evidence, accept caller-chosen commands and paths, and report actual runtime failures.

Harden provider results, schema serialization, snapshot evidence binding, archive paths, source maps, native screenshots, managed EH parsing, and cancellation cleanup. Regenerate tool metadata and document direct invocation.

BREAKING CHANGE: Removed permission configuration and policy commands, approval fields, filesystem scope inputs, and fixed confirmation options. Process capture inherits the host environment and accepts command names; callers must refresh tool schemas and migrate removed fields.
This commit is contained in:
morluto
2026-10-05 20:16:44 +08:00
committed by GitHub
parent 4f099a10f8
commit b5e98915c6
350 changed files with 5347 additions and 10599 deletions
+10 -11
View File
@@ -30,15 +30,8 @@ export const normalizeArtifactPath = (input: string): string => {
/** Reject exact, Unicode-normalized, case-folded, and prefix collisions. */
export class ArtifactPathRegistry {
readonly #root: PathTrieNode = { kind: undefined, children: new Map() };
readonly #folded = new Set<string>();
add(path: string, kind: "file" | "directory" | "symlink" | "slice"): void {
const folded = path.toLocaleLowerCase("en-US");
if (this.#folded.has(folded))
throw new ArtifactReaderFailure(
"path",
`Artifact path collision: ${path}`,
);
const parts = path.split("/");
let node = this.#root;
for (const [index, part] of parts.entries()) {
@@ -47,10 +40,16 @@ export class ArtifactPathRegistry {
"path",
`Artifact prefix conflict: ${path}`,
);
let child = node.children.get(part);
const foldedPart = part.toLocaleLowerCase("en-US");
let child = node.children.get(foldedPart);
if (child !== undefined && child.spelling !== part)
throw new ArtifactReaderFailure(
"path",
`Artifact path collision: ${path}`,
);
if (child === undefined) {
child = { kind: undefined, children: new Map() };
node.children.set(part, child);
child = { spelling: part, kind: undefined, children: new Map() };
node.children.set(foldedPart, child);
}
node = child;
if (index === parts.length - 1) {
@@ -67,11 +66,11 @@ export class ArtifactPathRegistry {
}
}
node.kind = kind;
this.#folded.add(folded);
}
}
interface PathTrieNode {
readonly spelling?: string;
kind: "file" | "directory" | "symlink" | "slice" | undefined;
readonly children: Map<string, PathTrieNode>;
}