@struktoai/mirage-core
Version:
A Unified Virtual Filesystem For AI Agents
46 lines • 2.56 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 { z } from 'zod';
import { GoogleConfig } from "../../core/google/config.js";
import { orderedTimes, timeRangeOrderError, timeRangeShape } from "../../core/time_config.js";
// Calendar-only knobs live here, not on the shared Google base, so a drive
// or docs mount cannot be handed a time zone that means nothing to it.
// `safeExtend` is zod's spelling for extending a refined object: the base's
// credential check rides along, and unlike `.extend` it cannot throw at
// import time should a key here ever shadow one of the base's. Mirrors
// python's `GCalConfig(GoogleConfig)`.
export const GCalConfig = GoogleConfig.safeExtend({
...timeRangeShape,
// One zone for the whole mount, not one per calendar: the Calendar UI
// draws its whole grid in the primary zone, and per-calendar bucketing
// would make the same day directory name mean different 24-hour windows
// on different calendars.
timeZone: z
.string()
.optional()
.describe("IANA time zone the mount buckets every calendar's days in. Unset uses the primary calendar's zone."),
bucketDays: z
.literal([1, 7, 30])
.default(1)
.describe('Days each date directory under a calendar holds: `1` names it by its day, `7` and `30` by its first and last day (`<first>--<last>`).'),
minAccessRole: z
.string()
.optional()
.describe('List only calendars where the account has at least this access role: `freeBusyReader`, `reader`, `writer` or `owner`. Unset lists every calendar.'),
today: z
.string()
.optional()
.describe("Day (`YYYY-MM-DD`) the default listing's 90-day future horizon is measured from, for tests and snapshots. Unset uses the current date in the mount's time zone."),
}).refine(orderedTimes, timeRangeOrderError);
//# sourceMappingURL=config.js.map