mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-12 07:50:43 +00:00
[codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives * refactor: use fs-safe for file access helpers * refactor: reuse fs-safe for media reads * refactor: use fs-safe for image reads * refactor: reuse fs-safe in qqbot media opener * refactor: reuse fs-safe for local media checks * refactor: consume cleaner fs-safe api * refactor: align fs-safe json option names * fix: preserve fs-safe migration contracts * refactor: use fs-safe primitive subpaths * refactor: use grouped fs-safe subpaths * refactor: align fs-safe api usage * refactor: adapt private state store api * chore: refresh proof gate * refactor: follow fs-safe json api split * refactor: follow reduced fs-safe surface * build: default fs-safe python helper off * fix: preserve fs-safe plugin sdk aliases * refactor: consolidate fs-safe usage * refactor: unify fs-safe store usage * refactor: trim fs-safe temp workspace usage * refactor: hide low-level fs-safe primitives * build: use published fs-safe package * fix: preserve outbound recovery durability after rebase * chore: refresh pr checks
This commit is contained in:
committed by
GitHub
parent
61481eb34f
commit
538605ff44
@@ -2,7 +2,7 @@ import fs from "node:fs";
|
||||
import path from "node:path";
|
||||
import { applyMergePatch } from "../config/merge-patch.js";
|
||||
import type { OpenClawConfig } from "../config/types.openclaw.js";
|
||||
import { matchBoundaryFileOpenFailure, openBoundaryFileSync } from "../infra/boundary-file-read.js";
|
||||
import { matchRootFileOpenFailure, openRootFileSync } from "../infra/boundary-file-read.js";
|
||||
import { isRecord } from "../utils.js";
|
||||
import { normalizePluginsConfig, resolveEffectivePluginActivationState } from "./config-state.js";
|
||||
import type { PluginBundleFormat } from "./manifest-types.js";
|
||||
@@ -23,11 +23,11 @@ export function readBundleJsonObject(params: {
|
||||
rootDir: string;
|
||||
relativePath: string;
|
||||
onOpenFailure?: (
|
||||
failure: Extract<ReturnType<typeof openBoundaryFileSync>, { ok: false }>,
|
||||
failure: Extract<ReturnType<typeof openRootFileSync>, { ok: false }>,
|
||||
) => ReadBundleJsonResult;
|
||||
}): ReadBundleJsonResult {
|
||||
const absolutePath = path.join(params.rootDir, params.relativePath);
|
||||
const opened = openBoundaryFileSync({
|
||||
const opened = openRootFileSync({
|
||||
absolutePath,
|
||||
rootPath: params.rootDir,
|
||||
boundaryLabel: "plugin root",
|
||||
@@ -50,11 +50,11 @@ export function readBundleJsonObject(params: {
|
||||
}
|
||||
|
||||
export function resolveBundleJsonOpenFailure(params: {
|
||||
failure: Extract<ReturnType<typeof openBoundaryFileSync>, { ok: false }>;
|
||||
failure: Extract<ReturnType<typeof openRootFileSync>, { ok: false }>;
|
||||
relativePath: string;
|
||||
allowMissing?: boolean;
|
||||
}): ReadBundleJsonResult {
|
||||
return matchBoundaryFileOpenFailure(params.failure, {
|
||||
return matchRootFileOpenFailure(params.failure, {
|
||||
path: () => {
|
||||
if (params.allowMissing) {
|
||||
return { ok: true, raw: {} };
|
||||
|
||||
Reference in New Issue
Block a user