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.
| 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. | 1 | import assert from "node:assert/strict"; |
| 2 | import { test } from "node:test"; | |
| 3 | ||
| 4 | import type { AgentTemplate } from "@g1t/contracts"; | |
| 5 | ||
| An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how. | 6 | import { roleLine, routingWords, startPath, templateListings, templatePath, templatesPath } from "./agent-templates.ts"; |
| 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. | 7 | |
| An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how. | 8 | const template = (id: string, title: string): AgentTemplate => ({ |
| 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. | 9 | id, |
| 10 | display_name: title.split(" ")[0]!, | |
| 11 | handle: id, | |
| 12 | name_ideas: [], | |
| 13 | role: title, | |
| 14 | title, | |
| 15 | responsibilities: ["Do the work"], | |
| 16 | subagents: [], | |
| 17 | instructions: "", | |
| 18 | personality_preset: "crisp", | |
| 19 | routing: { floor: null, ceiling: null, providers: [], pinned: null }, | |
| 20 | }); | |
| 21 | ||
| 22 | test("templates live under Agents, and starting one opens the new-agent form with it chosen", () => { | |
| 23 | assert.equal(templatesPath("acme"), "/acme/-/agents/templates"); | |
| 24 | assert.equal(templatePath("acme", "qa"), "/acme/-/agents/templates/qa"); | |
| 25 | assert.equal(startPath("acme", "qa"), "/acme/-/agents/new?template=qa"); | |
| 26 | }); | |
| 27 | ||
| 28 | test("a template counts the agents started from it, not archived ones", () => { | |
| 29 | const [eng, qa] = templateListings( | |
| 30 | [template("engineering", "Software Engineer"), template("qa", "QA Engineer")], | |
| 31 | [ | |
| 32 | { id: "a1", handle: "otto", display_name: "Otto", template: "engineering", archived_at: null }, | |
| 33 | { id: "a2", handle: "bolt", display_name: "Bolt", template: "engineering", archived_at: "2026-10-01T00:00:00Z" }, | |
| 34 | { id: "a3", handle: "g1t", display_name: "g1t", template: null, archived_at: null }, | |
| 35 | ], | |
| 36 | ); | |
| 37 | assert.deepEqual(eng!.agents.map((a) => a.handle), ["otto"]); | |
| 38 | assert.equal(qa!.agents.length, 0); | |
| 39 | }); | |
| 40 | ||
| 41 | test("without the agents service, no agent is counted", () => { | |
| 42 | const [eng] = templateListings([template("engineering", "Software Engineer")], null); | |
| 43 | assert.deepEqual(eng!.agents, []); | |
| 44 | }); | |
| 45 | ||
| An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how. | 46 | test("templates list in the order they come, each a role and never a team", () => { |
| 47 | const listed = templateListings([template("a", "A One"), template("b", "B Two")], null); | |
| 48 | assert.deepEqual(listed.map((l) => l.template.id), ["a", "b"]); | |
| 49 | for (const { template: t } of listed) assert.ok(!("department" in t) && !("team" in t)); | |
| 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. | 50 | }); |
| 51 | ||
| 52 | test("a role and its model limits read as words", () => { | |
| An agent is on teams the way a person is: through team membership, with no team or department of its own. Add it to teams when you create it, from its profile or from the team's page; the Agents sidebar groups agents by the teams they're on, with those on none last; what an agent is told about its teammates, team budgets, skills reach, Spend's By team and the People pages all read memberships. Agents with an old team name matching a team are moved onto it once; the rest are left off a team. Templates name a role only. The agents, teams and people guides say how. | 53 | assert.equal(roleLine({ title: "QA Engineer", display_name: "Margo" }), "QA Engineer · Suggests Margo"); |
| 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. | 54 | assert.equal(routingWords({ floor: null, ceiling: null }), "Any model the work needs"); |
| 55 | assert.equal(routingWords({ floor: "large", ceiling: null }), "Large models or better"); | |
| 56 | assert.equal(routingWords({ floor: null, ceiling: "large" }), "Up to large models"); | |
| 57 | }); |