@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
42 lines • 1.98 kB
JavaScript
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// ========= Copyright 2026 @ Strukto.AI All Rights Reserved. =========
import { fitIdName } from "../../utils/naming.js";
import { firstText as pickString, requireId } from "../../utils/records.js";
import { sanitizeName } from "../../utils/sanitize.js";
export { sanitizeName } from "../../utils/sanitize.js";
export function workspaceDirname(workspace) {
const label = sanitizeName(pickString(workspace, 'displayName', 'name') || 'workspace');
return fitIdName(label, requireId(workspace));
}
export function boardDirname(board) {
const label = sanitizeName(pickString(board, 'name') || 'board');
return fitIdName(label, requireId(board));
}
export function listDirname(lst) {
const label = sanitizeName(pickString(lst, 'name') || 'list');
return fitIdName(label, requireId(lst));
}
export function cardDirname(card) {
const label = sanitizeName(pickString(card, 'name') || 'card');
return fitIdName(label, requireId(card));
}
export function memberFilename(member) {
const label = sanitizeName(pickString(member, 'fullName', 'username') || 'member');
return fitIdName(label, requireId(member), '.json');
}
export function labelFilename(label) {
const raw = pickString(label, 'name', 'color') || 'label';
return fitIdName(sanitizeName(raw), requireId(label), '.json');
}
//# sourceMappingURL=pathing.js.map