Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| A GitHub App installed straight on GitHub can be added to a workspace: Import from GitHub lists the installations your GitHub account can see that this workspace hasn't added, each with Add for owners, and coming back from GitHub without g1t's own start asks which of your workspaces to add it to instead of stopping; the GitHub guide says how. | 4 | import { connectorsFor } from "@g1t/contracts/connectors"; |
| 5 | ||
| 6 | import { | |
| 7 | INSTALL_COOKIE, | |
| 8 | STATE_COOKIE, | |
| 9 | cookie, | |
| 10 | githubConnected, | |
| 11 | installCookieValue, | |
| 12 | installWorkspace, | |
| 13 | installationSummary, | |
| 14 | newState, | |
| 15 | notYetAdded, | |
| 16 | readCookie, | |
| 17 | sameString, | |
| 18 | setupChoices, | |
| 19 | stateMatches, | |
| 20 | } from "./github.ts"; | |
| Customize replaces the Marketplace on the site and the phone: three tabs, Skills, Connectors and Plugins, each with Yours and Discover, a search and the owners' Add menu, all kept in the address. Skills' Yours is the library (drafts, each skill with an inline Available to control that attaches it to every agent, a team or one, g1t's foundational skills, and the repository it follows); its Discover lists every skill in every marketplace's plugins, grouped by marketplace, and Add installs the plugin that brings one. Connectors' Yours is the workspace's MCP servers with their state, tools, where they reach and what an owner does with them (sign in or out, a key, list tools again, remove), beside the integrations the workspace has connected; its Discover is the directory, MCP servers first and connected in a step (the browser signs in, a key is pasted, or neither), then g1t's integrations, each person's own, and what is coming; a connector has a page, a connect page by directory entry or address, and the sign-in's return lands on it. Plugins' Yours is what the workspace installed with what each brought, its switch, Update when the marketplace moved on, and Uninstall; its Discover is every plugin, narrowed by category and marketplace and sorted by marketplace or name, with g1t's announced ones muted as Soon; a plugin's page renders its README and lists its skills (given to agents from there), its subagents (Hire opens the new-agent form filled from one), its servers and what only Claude Code uses. Marketplaces have a page; requests moved under Customize and name plugins, skills and connectors. Apps lists installed plugins and connectors beside integrations, ⌘K, the Apps page, the phone's More and the breadcrumbs say Customize, and the Marketplace's and the skill library's old addresses redirect. An agent's Abilities tab shows the connectors that reach it as Connectors, with per-tool levels, and keeps Add an MCP server under Only this agent; Templates lists the agents installed plugins bring; an agent's Skills tab says which plugin a skill came from. The phone's deep links open Customize's tabs. | 21 | import { connectorsDirectory } from "./customize.ts"; |
| Invite-only launch: sign in with GitHub, repository access and lifecycle, many emails, a new look | 22 | |
| 23 | test("the state must come back exactly as it was given", () => { | |
| 24 | const state = newState(); | |
| 25 | assert.match(state, /^[0-9a-f]{64}$/); | |
| 26 | assert.notEqual(state, newState()); | |
| 27 | assert.ok(stateMatches(state, state)); | |
| 28 | assert.ok(!stateMatches(state, state.slice(0, -1) + (state.endsWith("0") ? "1" : "0"))); | |
| 29 | assert.ok(!stateMatches(null, state)); | |
| 30 | assert.ok(!stateMatches(state, null)); | |
| 31 | assert.ok(!stateMatches("", "")); | |
| 32 | assert.ok(!sameString("abc", "abcd")); | |
| 33 | }); | |
| 34 | ||
| 35 | test("cookies are read by name, and odd values are ignored", () => { | |
| 36 | const header = `g1t_session=${"a".repeat(64)}; ${STATE_COOKIE}=abc123; other=x`; | |
| 37 | assert.equal(readCookie(header, STATE_COOKIE), "abc123"); | |
| 38 | assert.equal(readCookie(header, "missing"), null); | |
| 39 | assert.equal(readCookie(`${STATE_COOKIE}=<script>`, STATE_COOKIE), null); | |
| 40 | assert.equal(readCookie(null, STATE_COOKIE), null); | |
| 41 | const set = cookie(STATE_COOKIE, "abc", 600); | |
| 42 | assert.match(set, /HttpOnly/); | |
| 43 | assert.match(set, /Secure/); | |
| 44 | assert.match(set, /SameSite=Lax/); | |
| 45 | assert.match(set, /Max-Age=600/); | |
| 46 | }); | |
| 47 | ||
| 48 | test("an installation returns to the workspace it was started for", () => { | |
| 49 | const state = newState(); | |
| 50 | const value = installCookieValue(state, "acme"); | |
| 51 | assert.equal(readCookie(`${INSTALL_COOKIE}=${value}`, INSTALL_COOKIE), value); | |
| 52 | assert.equal(installWorkspace(value, state), "acme"); | |
| 53 | assert.equal(installWorkspace(value, newState()), null); | |
| 54 | assert.equal(installWorkspace(value, null), null); | |
| 55 | assert.equal(installWorkspace(null, state), null); | |
| 56 | assert.equal(installWorkspace(`${state}.`, state), null); | |
| 57 | }); | |
| A GitHub App installed straight on GitHub can be added to a workspace: Import from GitHub lists the installations your GitHub account can see that this workspace hasn't added, each with Add for owners, and coming back from GitHub without g1t's own start asks which of your workspaces to add it to instead of stopping; the GitHub guide says how. | 58 | |
| 59 | const seen = (id: number, account: string, recordedIn: string[], accountType = "Organization") => ({ | |
| 60 | id, | |
| 61 | account, | |
| 62 | accountType, | |
| 63 | repositorySelection: "all", | |
| 64 | suspended: false, | |
| 65 | settingsUrl: `https://github.com/organizations/${account}/settings/installations/${id}`, | |
| 66 | recordedIn, | |
| 67 | }); | |
| 68 | ||
| 69 | test("an installation made on GitHub directly is offered to the workspaces that lack it", () => { | |
| 70 | const listed = [seen(1, "flagon-io", []), seen(2, "syntaqx", ["syntaqx"], "User"), seen(3, "acme", ["flagon-io"])]; | |
| 71 | assert.deepEqual( | |
| 72 | notYetAdded(listed, "flagon-io").map((item) => item.account), | |
| 73 | ["flagon-io", "syntaqx"], | |
| 74 | ); | |
| 75 | assert.deepEqual( | |
| 76 | notYetAdded(listed, "syntaqx").map((item) => item.id), | |
| 77 | [1, 3], | |
| 78 | ); | |
| 79 | assert.equal(installationSummary(listed[0]!), "Organization · all repositories"); | |
| 80 | assert.equal(installationSummary({ accountType: "User", repositorySelection: "selected" }), "Personal · selected repositories"); | |
| 81 | }); | |
| 82 | ||
| 83 | test("the setup page offers only workspaces the person owns, saying which have it", () => { | |
| 84 | const workspaces = [ | |
| 85 | { slug: "flagon-io", name: "Flagon", role: "owner" }, | |
| 86 | { slug: "acme", role: "member" }, | |
| 87 | { slug: "syntaqx", name: null, role: "owner" }, | |
| 88 | ]; | |
| 89 | assert.deepEqual(setupChoices(workspaces, seen(1, "flagon-io", ["syntaqx"])), [ | |
| 90 | { slug: "flagon-io", name: "Flagon", added: false }, | |
| 91 | { slug: "syntaqx", name: "syntaqx", added: true }, | |
| 92 | ]); | |
| 93 | assert.deepEqual( | |
| 94 | setupChoices(workspaces, null).map((choice) => choice.added), | |
| 95 | [false, false], | |
| 96 | ); | |
| 97 | }); | |
| 98 | ||
| Customize replaces the Marketplace on the site and the phone: three tabs, Skills, Connectors and Plugins, each with Yours and Discover, a search and the owners' Add menu, all kept in the address. Skills' Yours is the library (drafts, each skill with an inline Available to control that attaches it to every agent, a team or one, g1t's foundational skills, and the repository it follows); its Discover lists every skill in every marketplace's plugins, grouped by marketplace, and Add installs the plugin that brings one. Connectors' Yours is the workspace's MCP servers with their state, tools, where they reach and what an owner does with them (sign in or out, a key, list tools again, remove), beside the integrations the workspace has connected; its Discover is the directory, MCP servers first and connected in a step (the browser signs in, a key is pasted, or neither), then g1t's integrations, each person's own, and what is coming; a connector has a page, a connect page by directory entry or address, and the sign-in's return lands on it. Plugins' Yours is what the workspace installed with what each brought, its switch, Update when the marketplace moved on, and Uninstall; its Discover is every plugin, narrowed by category and marketplace and sorted by marketplace or name, with g1t's announced ones muted as Soon; a plugin's page renders its README and lists its skills (given to agents from there), its subagents (Hire opens the new-agent form filled from one), its servers and what only Claude Code uses. Marketplaces have a page; requests moved under Customize and name plugins, skills and connectors. Apps lists installed plugins and connectors beside integrations, ⌘K, the Apps page, the phone's More and the breadcrumbs say Customize, and the Marketplace's and the skill library's old addresses redirect. An agent's Abilities tab shows the connectors that reach it as Connectors, with per-tool levels, and keeps Add an MCP server under Only this agent; Templates lists the agents installed plugins bring; an agent's Skills tab says which plugin a skill came from. The phone's deep links open Customize's tabs. | 99 | test("once an installation is recorded, Customize and Integrations say GitHub is connected", () => { |
| A GitHub App installed straight on GitHub can be added to a workspace: Import from GitHub lists the installations your GitHub account can see that this workspace hasn't added, each with Add for owners, and coming back from GitHub without g1t's own start asks which of your workspaces to add it to instead of stopping; the GitHub guide says how. | 100 | assert.equal(githubConnected([]), null); |
| 101 | const state = githubConnected([{ account: "flagon-io", suspended: false }]); | |
| 102 | assert.deepEqual(state, { detail: "On flagon-io", problem: null, manage: null }); | |
| Customize replaces the Marketplace on the site and the phone: three tabs, Skills, Connectors and Plugins, each with Yours and Discover, a search and the owners' Add menu, all kept in the address. Skills' Yours is the library (drafts, each skill with an inline Available to control that attaches it to every agent, a team or one, g1t's foundational skills, and the repository it follows); its Discover lists every skill in every marketplace's plugins, grouped by marketplace, and Add installs the plugin that brings one. Connectors' Yours is the workspace's MCP servers with their state, tools, where they reach and what an owner does with them (sign in or out, a key, list tools again, remove), beside the integrations the workspace has connected; its Discover is the directory, MCP servers first and connected in a step (the browser signs in, a key is pasted, or neither), then g1t's integrations, each person's own, and what is coming; a connector has a page, a connect page by directory entry or address, and the sign-in's return lands on it. Plugins' Yours is what the workspace installed with what each brought, its switch, Update when the marketplace moved on, and Uninstall; its Discover is every plugin, narrowed by category and marketplace and sorted by marketplace or name, with g1t's announced ones muted as Soon; a plugin's page renders its README and lists its skills (given to agents from there), its subagents (Hire opens the new-agent form filled from one), its servers and what only Claude Code uses. Marketplaces have a page; requests moved under Customize and name plugins, skills and connectors. Apps lists installed plugins and connectors beside integrations, ⌘K, the Apps page, the phone's More and the breadcrumbs say Customize, and the Marketplace's and the skill library's old addresses redirect. An agent's Abilities tab shows the connectors that reach it as Connectors, with per-tool levels, and keeps Add an MCP server under Only this agent; Templates lists the agents installed plugins bring; an agent's Skills tab says which plugin a skill came from. The phone's deep links open Customize's tabs. | 103 | const { integrations } = connectorsDirectory(connectorsFor("workspace"), [], { github: state! }, {}, "flagon-io"); |
| 104 | const github = integrations.find((entry) => entry.view.id === "github"); | |
| 105 | assert.equal(github?.state?.detail, "On flagon-io"); | |
| 106 | assert.equal(integrations[0]!.view.id, "github", "connected ones come first"); | |
| A GitHub App installed straight on GitHub can be added to a workspace: Import from GitHub lists the installations your GitHub account can see that this workspace hasn't added, each with Add for owners, and coming back from GitHub without g1t's own start asks which of your workspaces to add it to instead of stopping; the GitHub guide says how. | 107 | assert.equal( |
| 108 | githubConnected([ | |
| 109 | { account: "a", suspended: false }, | |
| 110 | { account: "b", suspended: true }, | |
| 111 | ])?.problem, | |
| 112 | "The installation on b is suspended on GitHub.", | |
| 113 | ); | |
| 114 | }); |