matthewwong525/WongStack / .agents/plugins/access
access
VerifiedSee who can sign in and what each person may use; add, change or remove a person.
screen/address.mjs
View on GitHub// Where the page lives and how its addresses are made. `mount` sets the page's own address once, before it draws.
let home = "/apps/access/";
/** Sets the page's own address, such as `/apps/access/`, with one slash at the end. */
export const setHome = value => { home = value.endsWith("/") ? value : `${value}/`; };
/** The page's own address. */
export const homePath = () => home;
/** An address inside Access: `at()` is People, `at('roles')` a view, `at('roles', id)` one role beside its list. */
export const at = (...parts) => `${home}${parts.map(encodeURIComponent).join("/")}`;
/** The parts of an address inside Access, decoded; null for an address outside it. */
export const partsOf = path => {
if (!`${path}/`.startsWith(home)) return null;
return path.slice(home.length).split("/").map(part => { try { return decodeURIComponent(part); } catch { return part; } });
};
/** The owner's three views, in the order the switch shows them. People opens first. Services shows only when the
* project gives keys. */
export const VIEWS = [
{ name: "people", title: "People", get home() { return at(); } },
{ name: "roles", title: "Roles", get home() { return at("roles"); } },
{ name: "services", title: "Services", get home() { return at("services"); } },
];
/** The id of a view's name in the switch: the list under the switch is labelled by it. */
export const viewLabel = view => `access-view-${view.name}`;
/** What the last change came to, as it rides with the address it led to: the words, whether it failed, the save that
* puts a person back, and a person just given the project to welcome. Anything else is no change said. */
export function readSaid(state) {
if (typeof state !== "object" || state === null || typeof state.text !== "string" || typeof state.failed !== "boolean") return undefined;
const undo = typeof state.undo === "object" && state.undo !== null ? state.undo : undefined;
const welcome = typeof state.welcome === "string" ? state.welcome : undefined;
return { text: state.text, failed: state.failed, ...(undo && { undo }), ...(welcome && { welcome }) };
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |