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.
| Chat and workspace agents: channels, DMs and named agents you talk to | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import { checkHandle } from "./handle.ts"; | |
| 5 | ||
| 6 | const handle = (value: unknown) => { | |
| 7 | const checked = checkHandle(value); | |
| 8 | return checked.ok ? checked.handle : null; | |
| 9 | }; | |
| 10 | ||
| 11 | test("a handle is 2 to 32 lowercase letters, digits and single hyphens", () => { | |
| 12 | assert.equal(handle("ship"), "ship"); | |
| 13 | assert.equal(handle("on-call-2"), "on-call-2"); | |
| 14 | assert.equal(handle("ab"), "ab"); | |
| 15 | assert.equal(handle("a".repeat(32)), "a".repeat(32)); | |
| 16 | assert.equal(handle("a"), null, "too short"); | |
| 17 | assert.equal(handle("a".repeat(33)), null, "too long"); | |
| 18 | assert.equal(handle("-ship"), null, "no leading hyphen"); | |
| 19 | assert.equal(handle("ship-"), null, "no trailing hyphen"); | |
| 20 | assert.equal(handle("on--call"), null, "no doubled hyphen"); | |
| 21 | assert.equal(handle("re_view"), null, "no underscores"); | |
| 22 | assert.equal(handle("rev.iew"), null, "no dots"); | |
| 23 | assert.equal(handle(42), null, "only text"); | |
| 24 | }); | |
| 25 | ||
| 26 | test("a handle is read the way people type it", () => { | |
| 27 | assert.equal(handle(" @Ship "), "ship", "trimmed, lowercased, the @ dropped"); | |
| 28 | }); | |
| 29 | ||
| 30 | test("g1t's own names and routes are reserved", () => { | |
| The Marketplace adds what g1t doesn't do and connects what you already use: extensions (Mail, Support, CRM, Recruiting, On-call, and bridges to a helpdesk, CRM or ERP you run, all Soon), starter kits, and integrations connected by the workspace or by each person; agents aren't installed there. Agent templates live in Agents, as starting points you configure, at Agents → Templates, and the Marketplace's old agent addresses lead there. The marketplace and agents guides say how. | 31 | for (const name of ["g1t", "G1T", "g1t-agent", "settings", "admin", "inbox", "new", "templates", "runs", "fleet"]) { |
| Chat and workspace agents: channels, DMs and named agents you talk to | 32 | const checked = checkHandle(name); |
| 33 | assert.equal(checked.ok, false, name); | |
| 34 | if (!checked.ok) assert.match(checked.message, /reserved/); | |
| 35 | } | |
| 36 | }); |