mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-12-01 09:39:53 +01:00
Refine agent details, identity editing, responsive controls, and organization charts with three card tiers, clearer save feedback, and stable filtering. Guard instruction-file renames and root configuration updates in one transaction through the agent lifecycle integration, preserving conflict checks, rollback, and configuration history. Co-Authored-By: Paperclip <noreply@paperclip.ing>
23 lines
990 B
TypeScript
23 lines
990 B
TypeScript
/** Bound live WebGL contexts; excess placements retain their static image. */
|
|
function createCharacterSlots(limit: number) {
|
|
let owners: ReadonlySet<symbol> = new Set();
|
|
const listeners = new Set<() => void>();
|
|
const notify = () => { for (const listener of listeners) listener(); };
|
|
return {
|
|
subscribe(listener: () => void) { listeners.add(listener); return () => { listeners.delete(listener); }; },
|
|
getSnapshot() { return owners; },
|
|
acquire(id: symbol) {
|
|
if (owners.has(id)) return true;
|
|
if (owners.size >= limit) return false;
|
|
owners = new Set([...owners, id]); notify(); return true;
|
|
},
|
|
release(id: symbol) {
|
|
if (!owners.has(id)) return;
|
|
const next = new Set(owners); next.delete(id); owners = next; notify();
|
|
},
|
|
};
|
|
}
|
|
// Other app surfaces retain the single-hero budget. Org leaders share a bounded pool.
|
|
export const characterSlot = createCharacterSlots(1);
|
|
export const orgChartCharacterSlots = createCharacterSlots(8);
|