matthewwong525/WongStack / .agents/plugins/access
access
VerifiedSee who can sign in and what each person may use; add, change or remove a person.
screen/status.test.mjs
View on GitHubimport { expect, it } from "vitest";
import { canRetry, listed, signInLine } from "./status.mjs";
const status = (changes = {}) => ({ ownerEmail: "owner@example.com", viewer: { email: "owner@example.com", owner: true },
environment: "live", key: "ready", started: true, imported: 0, keysStarted: true, unticked: { people: [], roles: [] },
apps: [{ id: "hello", title: "Hello", description: "" }, { id: "orders", title: "Orders", description: "" }],
keys: [], roles: [], people: [], work: [], project: "ready", ...changes });
const person = (changes = {}) => ({ email: "bo@example.com", status: "active", settled: true, role: null, apps: ["hello"], keys: {}, ...changes });
it("gives each person one sign-in status", () => {
expect(signInLine(person(), status())).toEqual({ text: "Can sign in", unfinished: false });
expect(signInLine(person({ settled: false }), status())).toEqual({ text: "Can't sign in yet", unfinished: true });
expect(signInLine(person({ settled: false }), status({ environment: "practice", key: "practice" }))).toEqual({ text: "Practice list", unfinished: false });
const removed = person({ status: "removed", apps: [] });
expect(signInLine(removed, status())).toEqual({ text: "Removed", unfinished: false });
expect(signInLine({ ...removed, settled: false }, status())).toEqual({ text: "Removed · still signing out", unfinished: true });
expect(signInLine(removed, status({ work: [{ kind: "policy", status: "ready" }, { kind: "sessions", status: "failed" }] }))).toEqual({ text: "Removed · still signing out", unfinished: true });
expect(signInLine(removed, status({ work: [{ kind: "policy", status: "failed" }, { kind: "sessions", status: "ready" }] }))).toEqual({ text: "Removed", unfinished: false });
expect(signInLine({ ...removed, settled: false }, status({ environment: "practice", key: "practice" }))).toEqual({ text: "Removed", unfinished: false });
});
it("says Listed, never a sign-in state, for a project with no sign-in list", () => {
const none = status({ key: undefined });
expect(listed(none)).toBe(false);
expect([signInLine(person(), none), signInLine(person({ settled: false }), none)]).toEqual([{ text: "Listed", unfinished: false }, { text: "Listed", unfinished: false }]);
// A removed person is still Removed, and never still signing out: there is no list to sign out of.
expect(signInLine(person({ status: "removed", settled: false }), none)).toEqual({ text: "Removed", unfinished: false });
expect(canRetry(none)).toBe(false);
});
it("offers Try again only where it can work", () => {
expect(canRetry(status())).toBe(true);
for (const changes of [{ key: "missing" }, { started: false }, { environment: "practice", key: "practice" }]) expect(canRetry(status(changes))).toBe(false);
});
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 |