Official
codex
Codex agent provider: runs the Codex CLI's app-server for each account.
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/codex@0.2.5
Permissions in 0.2.5
Files
quota.ts1.4 KB
// Display snapshots merge sparse pushes; recovery permission always uses fresh evidence.
import type * as z from "zod";
import type * as wire from "./wire.ts";
type Limits = z.infer<typeof wire.limits>;
function mergeValues<T extends object>(previous: T | null | undefined, update: T): T {
const merged = { ...previous, ...update };
for (const key of Object.keys(update) as (keyof T)[]) {
const value = update[key];
if (value == null && previous?.[key] != null) merged[key] = previous[key];
else if (value && typeof value === "object" && !Array.isArray(value)) merged[key] = mergeValues(previous?.[key] as object | undefined, value) as T[keyof T];
}
return merged;
}
export function mergeLimits(previous: Limits | null, update: Limits): Limits {
const merged = mergeValues(previous, update);
const buckets = mergeValues(previous?.rateLimitsByLimitId, update.rateLimitsByLimitId ?? {});
if (previous?.rateLimits?.limitId && !buckets[previous.rateLimits.limitId]) buckets[previous.rateLimits.limitId] = previous.rateLimits;
if (update.rateLimits?.limitId) buckets[update.rateLimits.limitId] = mergeValues(buckets[update.rateLimits.limitId], update.rateLimits);
if (update.rateLimits?.limitId && update.rateLimits.limitId !== previous?.rateLimits?.limitId) merged.rateLimits = buckets[update.rateLimits.limitId];
if (Object.keys(buckets).length) merged.rateLimitsByLimitId = buckets;
return merged;
}
No comments yet.