Skip to content
1,090 linesCodeBlameRaw

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 to1/**
2 * A workspace's own agents: named members with a job, a personality,
3 * routing limits and a budget, kept by the agents service
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)4 * (`services/agents`). Every workspace also has `@g1t`, its built-in
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.5 * orchestrator, kept the same way (`builtin`).
Chat and workspace agents: channels, DMs and named agents you talk to6 *
7 * Wire shapes are snake_case end to end.
8 */
9import type { ServiceBinding } from "./clients";
10import type { Role, User } from "./identity";
11import type { Result } from "./result";
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar12import type { CardActionResult } from "./chat";
Chat and workspace agents: channels, DMs and named agents you talk to13
14// Model tiers (`ModelTier`, `MODEL_TIERS`) are integrations.ts's, the
15// same ones runs are routed between.
16import type { ModelTier } from "./integrations";
The Marketplace is where a workspace finds what to add, reached from Apps: the agent catalog of roles with who already does each job and Add to workspace; every integration with whether it's connected; g1t's own extensions, listed as Soon; and requests, where members ask and owners add or turn down, each told by a notification. Underneath, an extension is a manifest (publisher and tier, source and version from a tag, scopes, the domains its data goes to, its page on g1tusercontent.com, no price) and an install pins its version with an off switch, a budget and the audit log. Apps lists only what was added from the Marketplace, with pins; g1t's own pages stay in their sidebars, and AI Gateway joins Workspace's. The marketplace guide says how.17import type { ExtensionInstall, InstallRequest, InstallRequestStatus, InstallRequests } from "./marketplace";
Each agent has an Abilities tab: g1t's built-ins, always on within the asker's access; its computer, coming; each connected integration's actions one row each, read, import, comment or resolve, with a level for each, alone, alone when the person asked for it, ask first or never, and whose connection it runs on; and MCP servers an owner adds. Reading is alone, writing inside g1t follows today's choices, anything that leaves g1t asks first, and production deploys can't go above ask. The agents service enforces every level: ask first posts a card to allow or deny and parks a session until it's answered, a refusal names its rule in the transcript and the audit log, and a missing ability posts a request to owners. The agent abilities guide says how.18import type { AgentAbilities, AgentAbilitiesChange, McpServer } from "./abilities";
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.19import type { AgentLook } from "./agent-look";
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.20import type { AgentComputerCommand, AgentComputerStatus } from "./runner";
Chat and workspace agents: channels, DMs and named agents you talk to21
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)22/** The built-in orchestrator's handle; nobody else's agent may take it. */
23export const BUILTIN_AGENT_HANDLE = "g1t";
24
25/** The built-in orchestrator's template id: not one a workspace can adopt. */
26export const ORCHESTRATOR_TEMPLATE = "orchestrator";
27
Chat and workspace agents: channels, DMs and named agents you talk to28/** Voice presets; free text in `personality` refines them. */
29export type PersonalityPreset = "crisp" | "friendly" | "socratic" | "terse";
30
31export type AgentRouting = {
32 /** Never route below this tier. Null: no floor. */
33 floor: ModelTier | null;
34 /** Never route above this tier. Null: no ceiling. */
35 ceiling: ModelTier | null;
36 /**
37 * Where its model calls may go. Empty: anything the workspace allows.
38 * `g1t`: g1t's hosted models. `workspace`: the workspace's own providers
39 * (Integrations), whichever they are. Any other entry: one of the
40 * workspace's own providers by integration id. Entries combine, so
41 * `["g1t", "workspace"]` is both.
42 */
43 providers: string[];
44 /** Advanced: a fixed `provider/model`, for own endpoints. Usually null. */
45 pinned: string | null;
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.46 /**
47 * How hard it works (docs.g1t.sh/guides/agents/#effort): the tier its
48 * work starts on, how hard the model reasons, and how many steps a
49 * session may take. `auto` (the default; absent means it) picks per
50 * piece of work. The floor and ceiling still hold.
51 */
52 effort?: AgentEffort;
Chat and workspace agents: channels, DMs and named agents you talk to53};
54
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.55/** An agent's effort setting, cheapest first after `auto`. */
56export type AgentEffort = "auto" | "low" | "medium" | "high" | "max";
57
58export const AGENT_EFFORTS: readonly AgentEffort[] = ["auto", "low", "medium", "high", "max"];
59
60/** A level work actually ran at: what `auto` resolves to each time. */
61export type EffortLevel = Exclude<AgentEffort, "auto">;
62
63export const EFFORT_LEVELS: readonly EffortLevel[] = ["low", "medium", "high", "max"];
64
Chat and workspace agents: channels, DMs and named agents you talk to65export type AgentBudget = {
66 /** Monthly cap in micro-dollars. Null: only the workspace limit applies. */
67 monthly_micros: number | null;
68 daily_micros: number | null;
69 /** Default cap for one task. */
70 task_micros: number | null;
71};
72
73export type AgentAutonomy = {
74 open_pull_requests: "alone" | "approval";
75 merge: "alone" | "approval" | "never";
76 deploy_production: "approval" | "never";
77 edit_docs: "alone" | "suggest";
78};
79
80export type AgentStatus = "idle" | "working" | "waiting" | "out_of_budget" | "paused";
81
82export type WorkspaceAgent = {
83 id: string;
84 workspace_id: string;
85 /** Lowercase, unique in the workspace, never `g1t`. Mentioned as `@handle`. */
86 handle: string;
87 display_name: string;
88 /** Uploaded avatar hash, or null for the generated mark. */
89 avatar: string | null;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)90 /**
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.91 * What its generated face is drawn from (./agent-look.ts `lookFromSeed`),
92 * the same for the same seed everywhere. Set from the handle when it is
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)93 * made; changing it gives the agent a new face.
94 */
95 avatar_seed: string;
96 /**
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.97 * Its face as its owner chose it, part by part (./agent-look.ts), or
98 * null: the face `avatar_seed` draws. Shown wherever the agent appears.
99 */
100 look: AgentLook | null;
101 /**
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.102 * One line, as lists show it: "QA Engineer". Its title when not written.
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)103 */
Chat and workspace agents: channels, DMs and named agents you talk to104 role: string;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)105 /**
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.106 * Agents are hired into roles, not tasks: a title and broad
107 * responsibilities. The teams it is on are team memberships, as a
108 * person's are (identity `team_agents`), never part of the agent.
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)109 */
110 title: string;
111 /** What it is responsible for: 2 to 8 short duties, or none yet. */
112 responsibilities: string[];
113 /**
114 * Specialised help it will use inside its own work. Never members, never
115 * wider than their agent. Stored now; they run with tasks and sessions.
116 */
117 subagents: SubagentDef[];
118 /**
Agents recall what Docs say before they answer or work, and each has required reading119 * Its required reading: Docs spaces (by id) it checks first, every time
120 * it answers or works. It still reads only what the person it acts for,
121 * and everyone reading its answer, can read.
122 */
123 reading: string[];
124 /**
Every agent starts with g1t's foundational skills, playbooks for documents, research, data, code, communication, and files and media, each using only tools the agent already has and saying plainly what isn't possible yet: agents make PDFs, Word documents, spreadsheets, CSV and Markdown files with make_file, kept with a doc in Artifacts and served from g1tusercontent.com; an agent's Skills tab shows what each skill can do and with which tools, and owners turn a skill off per agent; the agent skills guide says how.125 * g1t's foundational skills turned off for it, by id (./skills.ts):
126 * every one is on unless named here. Off takes the skill's playbook out of
127 * its instructions; its tools stay as they are.
128 */
129 skills_off: string[];
130 /**
Each agent has an Abilities tab: g1t's built-ins, always on within the asker's access; its computer, coming; each connected integration's actions one row each, read, import, comment or resolve, with a level for each, alone, alone when the person asked for it, ask first or never, and whose connection it runs on; and MCP servers an owner adds. Reading is alone, writing inside g1t follows today's choices, anything that leaves g1t asks first, and production deploys can't go above ask. The agents service enforces every level: ask first posts a card to allow or deny and parks a session until it's answered, a refusal names its rule in the transcript and the audit log, and a missing ability posts a request to owners. The agent abilities guide says how.131 * What it may do (./abilities.ts, docs.g1t.sh/guides/agent-abilities/):
132 * its level and credentials for each ability it has a choice about, and
133 * the MCP servers an owner added to it. Empty means every default.
134 */
135 abilities: AgentAbilities;
136 /**
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)137 * Who it works with: `internal`, the workspace's own people (back
138 * office), or `customers` (front office). Only `internal` for now.
139 */
140 faces: AgentFaces;
Chat and workspace agents: channels, DMs and named agents you talk to141 /** The job: what it is responsible for and how it works. */
142 instructions: string;
143 personality_preset: PersonalityPreset;
144 /** Free text refining the voice. Never changes what it may do. */
145 personality: string;
146 routing: AgentRouting;
147 budget: AgentBudget;
148 autonomy: AgentAutonomy;
149 /** Tasks it works at once; more queue on its desk. */
150 capacity: number;
151 /** The template it was made from, if any. */
152 template: string | null;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)153 /**
154 * The workspace's built-in orchestrator, `@g1t`: every workspace has one,
155 * made the first time its agents are asked for. It cannot be archived,
156 * and its handle, name, role and job are fixed; its `instructions` are
157 * added to that job. Listed first.
158 */
159 builtin: boolean;
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.160 /**
161 * Who it belongs to (docs.g1t.sh/guides/agents/, "Personal agents"):
162 * `workspace`, the workspace's own, which owners keep; or `personal`, a
163 * member's own, which only that member talks to, in their direct message
164 * with it, and whose spend counts against that member's budget.
165 */
166 scope: WorkspaceAgentScope;
167 /** For a personal agent, the member it belongs to: their user id and username. Null for a workspace agent. */
168 personal_owner_id: string | null;
169 personal_owner: string | null;
Chat and workspace agents: channels, DMs and named agents you talk to170 version: number;
171 status: AgentStatus;
172 /** Spend this calendar month, in micro-dollars. */
173 spent_month_micros: number;
174 created_by: string;
175 created_at: string;
176 updated_at: string;
177 archived_at: string | null;
178};
179
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)180/**
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.181 * Back office or front office (docs.g1t.sh/guides/agents/, "Back office
182 * and front office"). Customer-facing agents are not available yet.
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)183 */
184export type AgentFaces = "internal" | "customers";
185
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.186/** A workspace agent, which owners keep, or a member's personal agent. */
187export type WorkspaceAgentScope = "workspace" | "personal";
188
189/** What a personal agent starts with, unless its creator gives it other caps: $20 a month and $2 a session. */
190export const PERSONAL_AGENT_BUDGET = { monthly_micros: 20_000_000, daily_micros: null, task_micros: 2_000_000 } as const;
191
192/** Most personal agents one member keeps in a workspace. */
193export const MAX_PERSONAL_AGENTS = 10;
194
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)195/**
196 * A subagent: help an agent keeps for its own work, such as Margo's
197 * `flake-hunter`. Its routing limits sit within its agent's: a floor below
198 * the agent's is raised to it, a ceiling above is lowered to it.
199 */
200export type SubagentDef = {
201 /** Lowercase letters, digits and hyphens: `flake-hunter`. Unique on the agent. */
202 name: string;
203 /** One line: what it is for. */
204 description: string;
205 instructions: string;
206 routing: { floor: ModelTier | null; ceiling: ModelTier | null };
207 /** How many of it may run at once inside one task, 1 to 8. */
208 max_parallel: number;
209};
210
Chat and workspace agents: channels, DMs and named agents you talk to211export type NewWorkspaceAgent = {
212 handle: string;
213 display_name: string;
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.214 /** Left out or empty: its title. */
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)215 role?: string;
216 title?: string;
217 responsibilities?: string[];
218 subagents?: SubagentDef[];
Agents recall what Docs say before they answer or work, and each has required reading219 /** Docs spaces (by id) it reads first; at most 10. */
220 reading?: string[];
Every agent starts with g1t's foundational skills, playbooks for documents, research, data, code, communication, and files and media, each using only tools the agent already has and saying plainly what isn't possible yet: agents make PDFs, Word documents, spreadsheets, CSV and Markdown files with make_file, kept with a doc in Artifacts and served from g1tusercontent.com; an agent's Skills tab shows what each skill can do and with which tools, and owners turn a skill off per agent; the agent skills guide says how.221 /** Foundational skills to turn off, by id (./skills.ts). */
222 skills_off?: string[];
Each agent has an Abilities tab: g1t's built-ins, always on within the asker's access; its computer, coming; each connected integration's actions one row each, read, import, comment or resolve, with a level for each, alone, alone when the person asked for it, ask first or never, and whose connection it runs on; and MCP servers an owner adds. Reading is alone, writing inside g1t follows today's choices, anything that leaves g1t asks first, and production deploys can't go above ask. The agents service enforces every level: ask first posts a card to allow or deny and parks a session until it's answered, a refusal names its rule in the transcript and the audit log, and a missing ability posts a request to owners. The agent abilities guide says how.223 /**
224 * Its abilities' levels and credentials (./abilities.ts), whole: what is
225 * sent replaces what it had. MCP servers are added and removed with
226 * `addMcpServer` and `removeMcpServer`, never here.
227 */
228 abilities?: AgentAbilitiesChange;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)229 /** Only `internal` for now; `customers` is refused. */
230 faces?: AgentFaces;
Chat and workspace agents: channels, DMs and named agents you talk to231 instructions: string;
232 personality_preset?: PersonalityPreset;
233 personality?: string;
234 routing?: Partial<AgentRouting>;
235 budget?: Partial<AgentBudget>;
236 autonomy?: Partial<AgentAutonomy>;
237 capacity?: number;
238 template?: string | null;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)239 /** Its avatar's seed; left out, the handle. */
240 avatar_seed?: string;
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.241 /** Its face, chosen part by part (./agent-look.ts); null goes back to the seed's face. */
242 look?: AgentLook | null;
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.243 /**
244 * When creating: `workspace` (owners only, and their default) or
245 * `personal` (any member, when the workspace lets members make them; a
246 * member's default). Ignored on a change: an owner promotes instead.
247 */
248 scope?: WorkspaceAgentScope;
Chat and workspace agents: channels, DMs and named agents you talk to249};
250
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)251/**
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.252 * What g1t drafted from a description (docs.g1t.sh/guides/agents/,
253 * "Describe it"): a whole definition to edit before anything is saved,
254 * and what the agent will want around it. Nothing here is saved until the
255 * agent is created.
256 */
257export type AgentProposal = {
258 /** A complete definition, ready to create as it is. */
259 definition: NewWorkspaceAgent & { scope: WorkspaceAgentScope };
260 /** Other names that suit it, for the shuffle. */
261 name_ideas: string[];
262 /** Foundational skills it should keep on, by id (./skills.ts); the rest are off in `definition.skills_off`. */
263 skills: string[];
264 /** Integrations the job needs, from the catalog (./connectors.ts), with why. */
265 integrations: { id: string; why: string }[];
266 /** Routines that would suit it, to set up on its Routines tab once it exists. */
267 routines: { name: string; when: string; instructions: string }[];
268 /** What drafting it cost, charged to the person who asked (micro-dollars). */
269 charged_micros: number;
270};
271
272/** One line of a Try it conversation, held by the page, never saved. */
273export type DraftTurn = { role: "user" | "assistant"; content: string };
274
275/** A Try it answer, and what it cost the person trying it. */
276export type DraftReply = { text: string; charged_micros: number };
277
278/** Changes drafted from "Tell <name> what to change", to review before they are saved as a new version. */
279export type AgentRedraft = {
280 /** The changes to save, as `update` takes them: only fields that differ. */
281 changes: Partial<NewWorkspaceAgent>;
282 /** One line on what changed. */
283 summary: string;
284 /** The version it was drafted from. */
285 from_version: number;
286 charged_micros: number;
287};
288
289/**
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.290 * A role to hire an agent into, by title. Agents get names, not job
291 * titles ("Margo", the QA Engineer). A template never puts an agent on a
292 * team.
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)293 */
Chat and workspace agents: channels, DMs and named agents you talk to294export type AgentTemplate = {
295 id: string;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)296 /** The name it suggests first. */
Chat and workspace agents: channels, DMs and named agents you talk to297 display_name: string;
298 handle: string;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)299 /** Other names that suit it, for the form's shuffle. Each is also a valid handle, lowercased. */
300 name_ideas: string[];
Chat and workspace agents: channels, DMs and named agents you talk to301 role: string;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)302 title: string;
303 responsibilities: string[];
304 subagents: SubagentDef[];
Chat and workspace agents: channels, DMs and named agents you talk to305 instructions: string;
306 personality_preset: PersonalityPreset;
307 routing: AgentRouting;
308};
309
310/** What the chat service hands an agent: a message it should answer. */
311export type AgentDelivery = {
312 workspace: string;
313 workspace_id: string;
314 channel_id: string;
315 channel_kind: "channel" | "dm";
316 channel_name: string | null;
317 agent_id: string;
318 /** The message that woke it. */
319 message_id: string;
320 thread_root: string | null;
321 /** Who asked: the person's user id. */
322 asked_by: string;
323 /** Agent-to-agent hops so far in this chain. */
324 hops: number;
325 /**
326 * What the person who asked may do, from the viewer the chat service
327 * already holds when the message is posted (`askerAccess`). An agent
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.328 * never does more for someone than they could do themselves. Absent
329 * from an older chat service: the agent then treats the asker as unable
330 * to change code.
Chat and workspace agents: channels, DMs and named agents you talk to331 */
332 asker?: AskerAccess | null;
333 /**
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)334 * The agents that handled this request before this one, by id, oldest
335 * first; the last sent the work here. An agent never hands back or
336 * consults the one that sent it work, and the hop limit counts every
337 * hand-off and consult along the chain. Absent: none (a person asked).
338 */
339 chain?: string[];
340 /**
Chat and workspace agents: channels, DMs and named agents you talk to341 * Where the conversation is: g1t's own chat, or later another chat app
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.342 * the workspace connected. The agent reads and replies through that
343 * surface; its definition, budget and replies are the same everywhere.
344 * Absent: `g1t`.
Chat and workspace agents: channels, DMs and named agents you talk to345 */
346 surface?: AgentSurface;
347};
348
349/** The chat surfaces an agent answers on. Only g1t's own today. */
350export type AgentSurface = "g1t";
351
352/** Who asked an agent, as far as its reply needs to know. */
353export type AskerAccess = {
354 username: string;
355 /** Their role in the workspace; `outside` for someone who is not a member. */
356 role: Role | "outside";
357 /**
358 * Whether they can change code in the workspace: Code is on for them
359 * and they hold write access (or more) on at least one of its
360 * repositories, through the base permission or a grant.
361 */
362 can_write: boolean;
363};
364
365const WRITING_ROLES = new Set(["write", "maintain", "admin"]);
366
367/**
368 * `user`'s access in `workspace`, for `AgentDelivery.asker`. Pure, with no
369 * imports, so the chat service computes it from its viewer for free.
370 */
371export function askerAccess(user: User, workspace: string): AskerAccess {
372 const slug = workspace.toLowerCase();
373 const membership = user.workspaces?.find((m) => m.slug.toLowerCase() === slug);
374 // Someone who uses only Chat, Docs and agents sees no repository at all.
375 const code = membership?.code_access !== false;
376 const base = membership ? membership.role === "owner" || WRITING_ROLES.has(membership.base_permission ?? "write") : false;
377 const granted = (user.grants ?? []).some((grant) => grant.workspace.toLowerCase() === slug && WRITING_ROLES.has(grant.role));
378 return {
379 username: user.username,
380 role: membership?.role ?? "outside",
381 can_write: code && (base || granted),
382 };
383}
384
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked385/**
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.386 * A session: one bounded piece of work an agent took on
387 * (docs.g1t.sh/guides/agent-sessions/). A conversation with an agent is
388 * not a session: talking stays cheap and quick, and when a request needs
389 * real work the agent spins off a session for it, with its own context, transcript, budget and live card in
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked390 * the conversation. Sessions start other sessions (one of the agent's
391 * subagents, or a colleague brought in), and everything a tree of sessions
392 * spends is charged to the agent at its root, so a chain never escapes the
393 * budget that started it.
394 */
395export type AgentSessionKind =
396 /** Spun off from a conversation: someone asked for work. */
397 | "chat"
398 /** A routine's run. */
399 | "routine"
400 /** A colleague brought in by another session. */
401 | "helper"
402 /** One of the agent's own subagents, inside another session. */
403 | "subagent";
404
405export type AgentSessionStatus =
406 | "queued"
407 | "working"
408 /** Waiting on sessions it started. */
409 | "waiting"
410 /** Stopped at its spend cap: someone who may raise it decides. */
411 | "needs_approval"
412 | "done"
413 | "failed"
414 | "stopped";
415
416/** The statuses of a session that is not over. */
417export const SESSION_LIVE: readonly AgentSessionStatus[] = ["queued", "working", "waiting", "needs_approval"];
418
419export type AgentSession = {
420 id: string;
421 workspace_id: string;
422 agent_id: string;
423 /** The agent's handle, name and face, for lists. */
424 agent_handle: string;
425 agent_name: string;
426 agent_avatar_seed: string;
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.427 agent_look: AgentLook | null;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked428 /** The subagent running it, by name, when kind is `subagent`. */
429 subagent: string | null;
430 kind: AgentSessionKind;
431 /** The session that started it, and the root of its tree. */
432 parent_id: string | null;
433 root_id: string;
434 /** Whose budget pays for it: the agent at the root of its tree. */
435 payer_agent_id: string;
436 title: string;
437 goal: string;
438 status: AgentSessionStatus;
439 /** Why it is waiting, stopped or failed, in a line. */
440 status_note: string | null;
441 /** What it found or did, once done: its report. */
442 summary: string | null;
443 /** Where it reports: the conversation it was started from. */
444 channel_id: string;
445 channel_kind: "channel" | "dm";
446 channel_name: string | null;
447 /** Its live card in that conversation; its updates go in the card's thread. */
448 card_message_id: string | null;
449 asked_by: string | null;
450 asked_by_username: string | null;
451 routine_id: string | null;
452 steps: number;
453 tool_calls: number;
454 input_tokens: number;
455 output_tokens: number;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.456 /**
457 * At list price, what it counts against budgets: the model at the
458 * provider's price with billing's model margin, plus g1t's agent rate on
459 * every token. A root session's includes everything its tree spent.
460 */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked461 charged_micros: number;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.462 /** What its own steps' model answers cost at the provider's price, its tree's not included. */
463 cost_micros: number;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked464 /** The most it may spend before someone approves more. */
465 cap_micros: number | null;
466 model: string | null;
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.467 /** The effort level it ran at (the highest, when `auto` raised it); null for sessions from before effort was recorded. */
468 effort: EffortLevel | null;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked469 /** What it produced: issues filed, sessions started. */
470 outputs: SessionOutput[];
471 created_at: string;
472 updated_at: string;
473 finished_at: string | null;
474 /**
475 * False when the viewer is not among the people of the conversation it
476 * came from: they see that it ran and what it cost, never its title,
477 * goal, report or transcript.
478 */
479 visible: boolean;
480};
481
482export type SessionOutput =
483 | { kind: "issue"; repo: string; number: number; title: string }
484 | { kind: "session"; id: string; agent_handle: string; title: string }
485 | { kind: "memory"; id: string; body: string };
486
487/** One entry of a session's transcript, as its page shows it. */
488export type SessionEvent = {
489 seq: number;
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.490 kind: "goal" | "text" | "tool" | "command" | "steer" | "update" | "child" | "result" | "note";
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked491 /** Who: the agent's handle, a person's username (steering), or null for g1t's notes. */
492 by: string | null;
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.493 /** For `command`: the command on its first line, then its output, cut. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked494 body: string;
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.495 /** For `tool`: the tool, and whether it read, was withheld, refused or failed. For `command`: the directory it ran in. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked496 tool: string | null;
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.497 /** For `command`: `exit <code> · <duration>`, with `timed out` or `truncated` when so. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked498 outcome: string | null;
499 created_at: string;
500};
501
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.502/** An agent's computer as its Computer tab shows it (docs.g1t.sh/guides/agents/, "Its computer"). */
503export type AgentComputerView = {
504 status: AgentComputerStatus;
505 /** The most recent commands, newest first. */
506 commands: AgentComputerCommand[];
507 /** Whether the viewer may wake, sleep and reset it: owners, and the member of a personal agent. */
508 can_manage: boolean;
509};
510
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked511export type AgentSessionDetail = {
512 session: AgentSession;
513 events: SessionEvent[];
514 /** Every session in its tree, root first. */
515 tree: AgentSession[];
516 /** Whether the viewer may stop it, steer it, or approve more spend. */
517 can_stop: boolean;
518 can_steer: boolean;
519 can_approve: boolean;
520};
521
522/**
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.523 * What an agent remembers (docs.g1t.sh/guides/agent-memory/). Every fact
524 * carries where it came from, and its scope decides, in code, where it may
525 * be recalled and who may see it:
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked526 *
527 * - `workspace`: anywhere in the workspace. Owners write these, or an agent
528 * from a public channel, which every member can read already.
529 * - `channel`: only in that channel and its threads.
530 * - `person`: only in a direct message with that one person.
531 */
532export type AgentMemoryScope = "workspace" | "channel" | "person";
533
534export type AgentMemory = {
535 id: string;
536 agent_id: string;
537 scope: AgentMemoryScope;
538 /** The channel's id or the person's user id; empty for `workspace`. */
539 scope_ref: string;
540 /** The channel's name or the person's username, for display. */
541 scope_label: string | null;
542 body: string;
543 source_kind: "message" | "session" | "person";
544 /** A message id, a session id, or the username of who wrote it. */
545 source_ref: string | null;
546 source_label: string | null;
547 /** The channel the source is in, for a link. */
548 source_channel_id: string | null;
549 created_by: string;
550 created_by_kind: "agent" | "user";
551 pinned: boolean;
552 created_at: string;
553 updated_at: string;
554};
555
556/** When a routine runs, in UTC. */
557export type RoutineSchedule = {
558 every: "hour" | "day" | "weekday" | "week";
559 /** Minute of the hour, 0 to 59. */
560 minute: number;
561 /** Hour of the day (UTC), 0 to 23; not used for `hour`. */
562 hour: number;
563 /** Day of the week for `week`, 0 (Sunday) to 6. */
564 weekday: number;
565};
566
567/**
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened568 * Things that happen in the workspace a routine can run on
The docs folder is gone, and what it held lives where people read it: how a self-hosted g1t runs and how to deploy g1t to Cloudflare are pages on docs.g1t.sh under Run g1t yourself, and speed, rate limits and operating g1t.sh are sections of CONTRIBUTING.md; code that cited a file in docs/ now points to the page or section that covers it, or says what it means itself, and applied migrations and the runner images are left as they were.569 * (docs.g1t.sh/guides/agent-routines/). Each run is one session about the one
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened570 * thing that happened, in a repository its sponsor can read.
571 */
572export const ROUTINE_EVENTS = [
573 { key: "pull_ready", label: "A pull request is ready for review", hint: "Opened ready, or moved out of draft." },
574 { key: "pull_merged", label: "A pull request is merged", hint: "On any branch it targets." },
575 { key: "checks_failed", label: "Checks fail on a pull request", hint: "Its required checks failed or errored." },
576 { key: "issue_opened", label: "An issue is opened", hint: "By a person or an agent." },
577 { key: "deploy_failed", label: "A deploy fails", hint: "A production or preview deploy." },
578] as const;
579
580export type RoutineEvent = (typeof ROUTINE_EVENTS)[number]["key"];
581
582/**
Merge branch 'chat-sidebar' into fast-push583 * A routine: work an agent does on a schedule or when something happens, such as Sam's Monday digest
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked584 * of support themes. Each run is a session posted in the routine's channel,
585 * paid from the agent's budget, and run with the access of the person who
586 * set it up (its sponsor), never more.
587 */
588export type AgentRoutine = {
589 id: string;
590 agent_id: string;
591 name: string;
592 instructions: string;
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened593 /** When it runs on a clock; null when it runs only on events. */
594 schedule: RoutineSchedule | null;
595 /** What it runs on; empty when it runs only on its schedule. */
596 events: RoutineEvent[];
597 /** Which repositories its events come from, by `workspace/name`; empty: every one its sponsor can read. */
598 repos: string[];
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked599 channel_id: string;
600 channel_name: string | null;
601 sponsor: string;
602 sponsor_username: string | null;
603 enabled: boolean;
604 /** Why g1t paused it, when it did. */
605 paused_note: string | null;
606 next_run_at: string | null;
607 last_run_at: string | null;
608 last_session_id: string | null;
609 runs: number;
610 created_at: string;
611 updated_at: string;
612};
613
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened614/** A routine suggested from an agent's responsibilities, for an owner to add in one step. */
615export type RoutineSuggestion = { responsibility: string; routine: Omit<NewRoutine, "channel_id"> };
616
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked617export type NewRoutine = {
618 name: string;
619 instructions: string;
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened620 /** A schedule, events, or both; at least one. */
621 schedule: RoutineSchedule | null;
622 events?: RoutineEvent[];
623 repos?: string[];
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked624 /** A channel the agent is in, by id. */
625 channel_id: string;
626 enabled?: boolean;
627};
628
629/**
630 * The workspace's say over all its agents together, set by owners: one
631 * monthly budget across every agent, the budget a new agent starts with,
632 * and the cap a session starts with. The workspace's spend limit and AI
633 * credit (billing) sit above all of it.
634 */
635export type AgentPolicy = {
636 /** Every agent's spend together in a month. Null: only the workspace's spend limit. */
637 monthly_micros: number | null;
638 /** The monthly budget a new agent gets. Null: none. */
639 default_agent_monthly_micros: number | null;
640 /** The cap one session starts with, unless its agent's per-task cap is lower. */
641 default_session_micros: number;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.642 /**
643 * What the agents working for one person (their replies and sessions,
644 * asked for by that person) may spend together in a month, unless the
645 * person has a budget of their own. Null: no budget per person.
646 */
647 person_monthly_micros: number | null;
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.648 /**
649 * Whether members who aren't owners may create personal agents
650 * (docs.g1t.sh/guides/agents/, "Personal agents"). On unless an owner
651 * turns it off; off, existing personal agents keep working.
652 */
653 members_create_agents: boolean;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.654};
655
656/** One person's budget: what agents working for them may spend in a month, and what they have. */
657export type PersonBudget = {
658 username: string;
659 /** The budget that applies: their own, or the workspace's per-person default. Null: none. */
660 monthly_micros: number | null;
661 /** Whether it is their own, set by an owner, rather than the default. */
662 own: boolean;
663 /** What agents spent for them this month (UTC). */
664 spent_micros: number;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked665};
666
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.667/** Budgets per person: the default, and each person who has one of their own or has spent this month. */
668export type PersonBudgets = {
669 period: string;
670 default_micros: number | null;
671 /** Owners see everyone; anyone else sees only themselves. Most spent first. */
672 people: PersonBudget[];
673};
674
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked675export type SpendSlice = { key: string; label: string; micros: number; count: number };
676
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.677/** Which days a breakdown covers: this month (the default), last month, or the last 7 or 30 days, in UTC. */
678export type SpendPeriod = "month" | "last_month" | "7d" | "30d";
679
680/** Where an agent's (or every agent's) spend went over a period. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked681export type AgentSpendBreakdown = {
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.682 /** `YYYY-MM` for a month; for a span of days, the month it ends in. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked683 period: string;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.684 /** The span asked for, and its first and last day (`YYYY-MM-DD`, both included). */
685 span: SpendPeriod;
686 from: string;
687 until: string;
688 /** The one person it is about (work asked for by them), or null for everyone's. */
689 person: string | null;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked690 total_micros: number;
691 /** Chat replies, sessions, routines, helping colleagues. */
692 by_kind: SpendSlice[];
693 by_model: SpendSlice[];
694 /** Who asked: the work done for each person. */
695 by_person: SpendSlice[];
696 by_agent: SpendSlice[];
697 by_team: SpendSlice[];
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.698 /**
699 * Where it was asked: a channel by id (labelled `#name`), direct
700 * messages together (`dm`), and channels the viewer can't read together
701 * (`private`).
702 */
703 by_channel: SpendSlice[];
704 /** The costliest sessions in the period. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked705 top_sessions: AgentSession[];
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.706 /** Spend by day in the period. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked707 days: { day: string; micros: number }[];
708};
709
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.710/**
711 * What each effort level has cost one agent, from its own finished
712 * sessions (docs.g1t.sh/guides/spend/#effort): measured, never estimated
713 * from other agents or list prices. A level it has not run at has no
714 * figures.
715 */
716export type EffortCost = {
717 effort: EffortLevel;
718 /** Its sessions (with everything they brought in) that finished in the window. */
719 sessions: number;
720 /** The median charged for one of them: a typical task. Null with none. */
721 typical_micros: number | null;
722 /** Of those, the share finished with nobody having to step in: no steering, not stopped or failed. Null with none. */
723 accepted_share: number | null;
724};
725
726export type AgentEffortCosts = {
727 handle: string;
728 /** Its setting now. */
729 effort: AgentEffort;
730 /** Days of history the figures cover. */
731 window_days: number;
732 levels: EffortCost[];
733};
734
735/** One side of a recommendation's evidence: the agent's sessions at one level. */
736export type EffortEvidence = {
737 effort: EffortLevel;
738 sessions: number;
739 /** Finished with nobody having to step in. */
740 accepted: number;
741 typical_micros: number;
742 mean_micros: number;
743};
744
745/**
746 * A way to spend less without losing quality, checked against the agent's
747 * own past work (docs.g1t.sh/guides/spend/#spend-less-keep-quality). The
748 * weekly check proposes one only when the cheaper level's measured
749 * outcomes hold up; when there is too little history to tell, it says so
750 * (`thin`) instead of proposing anything.
751 */
752export type AgentRecommendation = {
753 id: string;
754 agent_id: string;
755 agent_handle: string;
756 agent_name: string;
757 agent_avatar_seed: string;
Agents have faces, and are never mistaken for people. Every agent wears a little bot face drawn from a look it owns, shape, colour, eyes, mouth, antenna, accessory and pattern, chosen in its builder and on its Profile tab with a live preview, Shuffle and a way back to the face its seed gives it; the face blinks on its own time, breathes, narrows its eyes while the agent works, shuts them asleep and bounces when it finishes, all of it still for anyone who asked for less motion. Wherever an agent shows, in chat, in a list, on a mention, on a review or a commit, its avatar carries an agent marker, and the people reading it are told so. In Chat, direct messages are two lists: People, and Agents, which also holds the agents you haven't talked to yet; a conversation with both a person and an agent in it is marked in the list, named in the conversation's header, spelled out by the composer and explained once the first time it opens. Agents keep their look in the agents service, which every service passes along. The chat and agents guides say so, and CONTRIBUTING makes the shared avatar the only way to draw an agent.758 agent_look: AgentLook | null;
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.759 /** Lowering its effort setting. */
760 kind: "effort";
761 /** `thin`: not enough history to recommend anything yet. */
762 status: "open" | "applied" | "dismissed" | "thin";
763 from_effort: AgentEffort;
764 to_effort: EffortLevel;
765 /** What it says to do, in a line. */
766 title: string;
767 /** Why, from the numbers in `evidence`, in a sentence. */
768 reason: string;
769 /** What it was measured on: the level it runs at now, and the cheaper one. Null sides had no sessions. */
770 evidence: { window_days: number; current: EffortEvidence | null; cheaper: EffortEvidence | null; needed: number };
771 /** About what a month it would save at the recent pace, from the measured costs. Null when thin. */
772 saving_month_micros: number | null;
773 checked_at: string;
774 resolved_by: string | null;
775 resolved_at: string | null;
776};
777
778export type AgentRecommendations = {
779 /** When the check last ran for the workspace; null before the first. */
780 checked_at: string | null;
781 window_days: number;
782 /** To act on, largest saving first. */
783 open: AgentRecommendation[];
784 /** Agents with too little history to say. */
785 thin: AgentRecommendation[];
786 /** Applied or dismissed in the last 30 days. */
787 resolved: AgentRecommendation[];
788};
789
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked790/** Agents mode's front page. */
791export type AgentsOverview = {
792 policy: AgentPolicy;
793 /** Every agent's spend this month, against the policy's budget. */
794 spent_month_micros: number;
795 /** The highest alert this month: 75, 90 or 100 (% of the workspace's agent budget). */
796 alert: number | null;
797 agents: WorkspaceAgent[];
798 /** Live sessions, counted by agent id, for the roster. */
799 live_by_agent: Record<string, number>;
800 /** Sessions live now that the viewer can see. */
801 live: AgentSession[];
802 /** Sessions waiting on the viewer: spend they may approve. */
803 waiting_on_you: AgentSession[];
804 /** Recently finished sessions the viewer can see. */
805 recent: AgentSession[];
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened806 /** The next routines to run on a schedule. */
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked807 upcoming: (AgentRoutine & { agent_handle: string; agent_name: string })[];
808 spend: AgentSpendBreakdown;
809 can_manage: boolean;
810};
811
812/** One thing an agent did, for its Activity tab. */
813export type AgentActivity = {
814 id: string;
815 kind: "reply" | "session";
816 status: string;
817 channel_id: string;
818 channel_name: string | null;
819 /** The session's title; null for a reply or one the viewer can't see. */
820 title: string | null;
821 asked_by_username: string | null;
822 model: string | null;
823 tools: number;
824 charged_micros: number;
825 created_at: string;
826 visible: boolean;
827 /** For a reply, the message it posted; for a session, its id. */
828 ref: string | null;
829};
830
831export type AgentVersion = { version: number; changed_by: string; created_at: string; definition: Partial<NewWorkspaceAgent> };
832
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar833/** A card action, as chat hands it to agents. */
834export type AgentCardAction = {
835 workspace: string;
836 channel_id: string;
837 message_id: string;
838 viewer: User;
839 card: { kind: string; ref: string | null };
840 action_id: string;
841 input: string | null;
842};
843
Chat and workspace agents: channels, DMs and named agents you talk to844export type WorkspaceAgentsApi = {
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.845 /**
846 * The workspace's agents. Personal agents are left out unless asked
847 * for: `mine`, the viewer's own; `all`, every member's for an owner (the
848 * viewer's own for anyone else).
849 */
850 list(workspace: string, viewer: User, options?: { personal?: "mine" | "all" | null }): Promise<Result<WorkspaceAgent[]>>;
Chat and workspace agents: channels, DMs and named agents you talk to851 get(workspace: string, handle: string, viewer: User): Promise<Result<WorkspaceAgent>>;
852 /** Internal: by id, for the chat service resolving members. */
853 byIds(ids: string[]): Promise<WorkspaceAgent[]>;
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.854 /**
855 * `teams`: the workspace's teams to add it to as it is made, by slug,
856 * each one the viewer manages (owners and the team's maintainers). The
857 * membership is the team's, as anyone's is; a personal agent joins none.
858 */
859 create(workspace: string, viewer: User, input: NewWorkspaceAgent, options?: { teams?: string[] }): Promise<Result<WorkspaceAgent>>;
Chat and workspace agents: channels, DMs and named agents you talk to860 update(
861 workspace: string,
862 handle: string,
863 viewer: User,
864 changes: Partial<NewWorkspaceAgent>,
865 ): Promise<Result<WorkspaceAgent>>;
866 archive(workspace: string, handle: string, viewer: User): Promise<Result<null>>;
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.867 /**
868 * Drafts a whole agent from a description, with a fast model call charged
869 * to the viewer. Nothing is saved. Whoever may create the agent may draft it.
870 */
871 draft(workspace: string, viewer: User, input: { description: string; scope?: WorkspaceAgentScope | null }): Promise<Result<AgentProposal>>;
872 /**
873 * Try it: the unsaved definition answers the conversation so far, as it
874 * would in a direct message, without tools or memory. Charged to the
875 * viewer; nothing is saved.
876 */
877 tryDraft(workspace: string, viewer: User, input: { definition: NewWorkspaceAgent; messages: DraftTurn[] }): Promise<Result<DraftReply>>;
878 /** Drafts changes to an agent from a request in words; saved only through `update`. Whoever may change the agent may ask. */
879 redraft(workspace: string, handle: string, viewer: User, request: string): Promise<Result<AgentRedraft>>;
880 /**
881 * Owners make a member's personal agent a workspace agent: its definition
882 * and every version move to a workspace agent with the same handle, and
883 * the personal one is archived, with its memory and direct messages.
884 */
885 promote(workspace: string, handle: string, viewer: User): Promise<Result<WorkspaceAgent>>;
Each agent has an Abilities tab: g1t's built-ins, always on within the asker's access; its computer, coming; each connected integration's actions one row each, read, import, comment or resolve, with a level for each, alone, alone when the person asked for it, ask first or never, and whose connection it runs on; and MCP servers an owner adds. Reading is alone, writing inside g1t follows today's choices, anything that leaves g1t asks first, and production deploys can't go above ask. The agents service enforces every level: ask first posts a card to allow or deny and parks a session until it's answered, a refusal names its rule in the transcript and the audit log, and a missing ability posts a request to owners. The agent abilities guide says how.886 /**
887 * Adds an MCP server to an agent (docs.g1t.sh/guides/agent-abilities/,
888 * "MCP servers"): its host is checked, its tools are listed from it, and
889 * the agent gets a new version with each tool as an ability. Owners only.
890 */
891 addMcpServer(workspace: string, handle: string, viewer: User, input: { name: string; url: string }): Promise<Result<McpServer>>;
892 /** Takes an MCP server off an agent, with its abilities: a new version. Owners only. */
893 removeMcpServer(workspace: string, handle: string, viewer: User, id: string): Promise<Result<null>>;
894 /** Lists a server's tools again, for one that changed; a new version when they did. Owners only. */
895 refreshMcpServer(workspace: string, handle: string, viewer: User, id: string): Promise<Result<McpServer>>;
Chat and workspace agents: channels, DMs and named agents you talk to896 templates(): Promise<AgentTemplate[]>;
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)897 /**
898 * Internal: the workspace's built-in `@g1t` agent, made if it does not
899 * exist yet. The chat service asks for it when someone mentions @g1t in
900 * a channel it is not in yet.
901 */
902 builtin(workspace: string, workspaceId: string): Promise<Result<WorkspaceAgent>>;
Chat and workspace agents: channels, DMs and named agents you talk to903 /** The chat service hands over a message for an agent to answer. Returns at once. */
904 deliver(delivery: AgentDelivery): Promise<Result<null>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked905 overview(workspace: string, viewer: User): Promise<Result<AgentsOverview>>;
906 sessions(
907 workspace: string,
908 viewer: User,
909 filter?: { handle?: string | null; status?: "live" | "done" | null; limit?: number | null },
910 ): Promise<Result<AgentSession[]>>;
911 session(workspace: string, id: string, viewer: User): Promise<Result<AgentSessionDetail>>;
912 /** Stops a session and every session under it. */
913 stopSession(workspace: string, id: string, viewer: User): Promise<Result<AgentSession>>;
914 /** Raises a stopped session's cap and lets it go on. Owners only. */
915 approveSession(workspace: string, id: string, viewer: User, capMicros: number): Promise<Result<AgentSession>>;
916 /** A person's message to a session, running or finished: it reads it and goes on. */
917 steerSession(workspace: string, id: string, viewer: User, body: string): Promise<Result<AgentSession>>;
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.918 /**
919 * The agent's computer: its state, disk and recent commands. Anyone who
920 * may see the agent; `can_manage` says whether the viewer may act on it.
921 */
922 computer(workspace: string, handle: string, viewer: User): Promise<Result<AgentComputerView>>;
923 /** Wakes it, restoring its home; metered until it sleeps. Owners, or a personal agent's member. */
924 wakeComputer(workspace: string, handle: string, viewer: User): Promise<Result<AgentComputerView>>;
925 /** Saves its home and stops it. Owners, or a personal agent's member. */
926 sleepComputer(workspace: string, handle: string, viewer: User): Promise<Result<AgentComputerView>>;
927 /** Wipes its home and its command history; memory and artifacts are kept. Owners, or a personal agent's member. */
928 resetComputer(workspace: string, handle: string, viewer: User): Promise<Result<AgentComputerView>>;
929 /** Its recent commands, newest first; `sessionId` narrows them to one session's. */
930 computerCommands(workspace: string, handle: string, viewer: User, sessionId?: string | null): Promise<Result<AgentComputerCommand[]>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked931 memories(workspace: string, handle: string, viewer: User): Promise<Result<AgentMemory[]>>;
932 remember(
933 workspace: string,
934 handle: string,
935 viewer: User,
936 input: { body: string; scope: AgentMemoryScope; scope_ref?: string | null },
937 ): Promise<Result<AgentMemory>>;
938 updateMemory(
939 workspace: string,
940 handle: string,
941 viewer: User,
942 id: string,
943 changes: { body?: string; pinned?: boolean },
944 ): Promise<Result<AgentMemory>>;
945 forget(workspace: string, handle: string, viewer: User, id: string): Promise<Result<null>>;
Routines run when something happens: a pull request ready for review or merged, checks or a deploy failing, an issue opened946 routines(workspace: string, handle: string, viewer: User): Promise<Result<{ routines: AgentRoutine[]; suggestions: RoutineSuggestion[] }>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked947 saveRoutine(workspace: string, handle: string, viewer: User, input: NewRoutine, id?: string | null): Promise<Result<AgentRoutine>>;
948 deleteRoutine(workspace: string, handle: string, viewer: User, id: string): Promise<Result<null>>;
949 /** Runs a routine now, as a session. */
950 runRoutine(workspace: string, handle: string, viewer: User, id: string): Promise<Result<AgentSession>>;
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.951 /**
952 * Where the spend went: one agent's, or every agent's; this month unless
953 * `period` says otherwise; for everyone, or only the work one `person`
954 * (by username) asked for.
955 */
956 spend(workspace: string, viewer: User, handle?: string | null, options?: { period?: SpendPeriod | null; person?: string | null }): Promise<Result<AgentSpendBreakdown>>;
957 /** Budgets per person this month: owners see everyone's, anyone else their own. */
958 personBudgets(workspace: string, viewer: User): Promise<Result<PersonBudgets>>;
959 /**
960 * Gives one person a monthly budget of their own (`monthly_micros`; 0 for
961 * no budget at all), or with null puts them back on the default. Owners only.
962 */
963 setPersonBudget(workspace: string, viewer: User, username: string, monthlyMicros: number | null): Promise<Result<PersonBudgets>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked964 activity(workspace: string, handle: string, viewer: User): Promise<Result<AgentActivity[]>>;
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.965 /** What each effort level has cost this agent, from its own finished sessions. Members only. */
966 effortCosts(workspace: string, handle: string, viewer: User): Promise<Result<AgentEffortCosts>>;
967 /** Ways to spend less, checked against past work: every agent's, or one's. Members only. */
968 recommendations(workspace: string, viewer: User, handle?: string | null): Promise<Result<AgentRecommendations>>;
969 /**
970 * Owners apply one (the agent's effort changes, as a new version, and
971 * the audit log says so) or dismiss it.
972 */
973 resolveRecommendation(workspace: string, viewer: User, id: string, action: "apply" | "dismiss"): Promise<Result<AgentRecommendation>>;
People and teams are front and centre: one directory of people and agents with presence, local time, titles, teams and what each owns; profiles with manager and reports and the agents they work with; an org chart with each team's agents beside the person who leads it; and teams of any mix, with a lead, a channel, a budget agents keep to and the agents on them. Every agent is told its teams each turn (who leads, who owns what, who's around and who to page), and the team page shows exactly what. Member management is Members and invites; the people and teams guide says how.974 /** What an agent is told about its teams this turn, word for word. Members only. */
975 teamContext(workspace: string, handle: string, viewer: User): Promise<Result<AgentTeamContext>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked976 versions(workspace: string, handle: string, viewer: User): Promise<Result<AgentVersion[]>>;
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar977 /**
978 * Internal, from chat: a person pressed an action on one of agents'
979 * cards. Agents checks they may, acts, and updates the card.
980 */
981 cardAction(input: AgentCardAction): Promise<Result<CardActionResult>>;
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked982 policy(workspace: string, viewer: User): Promise<Result<AgentPolicy>>;
983 setPolicy(workspace: string, viewer: User, policy: Partial<AgentPolicy>): Promise<Result<AgentPolicy>>;
The Marketplace is where a workspace finds what to add, reached from Apps: the agent catalog of roles with who already does each job and Add to workspace; every integration with whether it's connected; g1t's own extensions, listed as Soon; and requests, where members ask and owners add or turn down, each told by a notification. Underneath, an extension is a manifest (publisher and tier, source and version from a tag, scopes, the domains its data goes to, its page on g1tusercontent.com, no price) and an install pins its version with an off switch, a budget and the audit log. Apps lists only what was added from the Marketplace, with pins; g1t's own pages stay in their sidebars, and AI Gateway joins Workspace's. The marketplace guide says how.984 /**
985 * The Marketplace's install requests (./marketplace.ts): every one in the
986 * workspace for an owner, a member's own for anyone else.
987 */
988 installRequests(workspace: string, viewer: User): Promise<Result<InstallRequests>>;
989 /**
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.990 * A member asks the workspace's owners to add a listing
991 * (`extension:<id>` or `integration:<connector>`), and every owner is
992 * notified. Owners add
The Marketplace is where a workspace finds what to add, reached from Apps: the agent catalog of roles with who already does each job and Add to workspace; every integration with whether it's connected; g1t's own extensions, listed as Soon; and requests, where members ask and owners add or turn down, each told by a notification. Underneath, an extension is a manifest (publisher and tier, source and version from a tag, scopes, the domains its data goes to, its page on g1tusercontent.com, no price) and an install pins its version with an off switch, a budget and the audit log. Apps lists only what was added from the Marketplace, with pins; g1t's own pages stay in their sidebars, and AI Gateway joins Workspace's. The marketplace guide says how.993 * things themselves, so they don't ask. Asking again while a request for
994 * the same listing is open is a conflict.
995 */
996 requestInstall(workspace: string, viewer: User, listing: string, note?: string | null): Promise<Result<InstallRequest>>;
997 /** An owner marks a request added (`done`) or turns it down (`declined`); whoever asked is told. */
998 resolveInstallRequest(workspace: string, viewer: User, id: string, status: Exclude<InstallRequestStatus, "open">): Promise<Result<InstallRequest>>;
999 /** The extensions installed in the workspace; any member sees them. */
1000 extensionInstalls(workspace: string, viewer: User): Promise<Result<ExtensionInstall[]>>;
1001 /** Owners install a published extension at its current version; open requests for it are answered. */
1002 installExtension(workspace: string, viewer: User, extension: string): Promise<Result<ExtensionInstall>>;
1003 /** Owners switch an install on or off: off is the kill switch. */
1004 setExtensionEnabled(workspace: string, viewer: User, listing: string, enabled: boolean): Promise<Result<ExtensionInstall>>;
1005 /** Owners cap what an install spends a month; null leaves it to the workspace's limit. */
1006 setExtensionBudget(workspace: string, viewer: User, listing: string, monthlyMicros: number | null): Promise<Result<ExtensionInstall>>;
1007 uninstallExtension(workspace: string, viewer: User, listing: string): Promise<Result<null>>;
Chat and workspace agents: channels, DMs and named agents you talk to1008};
1009
1010async function rpc<T>(service: ServiceBinding, method: string, args: object): Promise<T> {
1011 const response = await service.fetch(`https://service/rpc/${method}`, {
1012 method: "POST",
1013 headers: { "content-type": "application/json" },
1014 body: JSON.stringify(args),
1015 });
1016 if (!response.ok) {
1017 throw new Error(`${method} failed with status ${response.status}`);
1018 }
1019 return (await response.json()) as T;
1020}
1021
People and teams are front and centre: one directory of people and agents with presence, local time, titles, teams and what each owns; profiles with manager and reports and the agents they work with; an org chart with each team's agents beside the person who leads it; and teams of any mix, with a lead, a channel, a budget agents keep to and the agents on them. Every agent is told its teams each turn (who leads, who owns what, who's around and who to page), and the team page shows exactly what. Member management is Members and invites; the people and teams guide says how.1022/**
1023 * What an agent is told about its teams every turn (docs.g1t.sh/guides/people-and-teams/,
1024 * "What agents are told"): the visible teams it is on, by slug, and the text
1025 * itself; null when it is on none.
1026 */
1027export type AgentTeamContext = { handle: string; teams: string[]; text: string | null };
1028
Chat and workspace agents: channels, DMs and named agents you talk to1029export function workspaceAgentsClient(service: ServiceBinding): WorkspaceAgentsApi {
1030 const call = <T>(method: string, args: object) => rpc<T>(service, method, args);
1031 return {
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.1032 list: (workspace, viewer, options) => call("list", { workspace, viewer, personal: options?.personal ?? null }),
Chat and workspace agents: channels, DMs and named agents you talk to1033 get: (workspace, handle, viewer) => call("get", { workspace, handle, viewer }),
1034 byIds: (ids) => call("by_ids", { ids }),
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.1035 create: (workspace, viewer, input, options) => call("create", { workspace, viewer, input, teams: options?.teams ?? [] }),
Chat and workspace agents: channels, DMs and named agents you talk to1036 update: (workspace, handle, viewer, changes) => call("update", { workspace, handle, viewer, changes }),
1037 archive: (workspace, handle, viewer) => call("archive", { workspace, handle, viewer }),
Anyone makes an agent by describing it: one box drafts the whole agent (name, job, responsibilities, voice, skills to keep, integrations it needs, model limits and budget) as a card to change and try in a chat beside it before creating it, and an agent changes later by saying what to change, shown as a diff before it's saved. Members can make personal agents, which only they talk to and which spend from their own budget, unless owners turn that off; owners promote one to a workspace agent. The agents guide says how.1038 draft: (workspace, viewer, input) => call("draft", { workspace, viewer, description: input.description, scope: input.scope ?? null }),
1039 tryDraft: (workspace, viewer, input) => call("try_draft", { workspace, viewer, definition: input.definition, messages: input.messages }),
1040 redraft: (workspace, handle, viewer, request) => call("redraft", { workspace, handle, viewer, request }),
1041 promote: (workspace, handle, viewer) => call("promote", { workspace, handle, viewer }),
Each agent has an Abilities tab: g1t's built-ins, always on within the asker's access; its computer, coming; each connected integration's actions one row each, read, import, comment or resolve, with a level for each, alone, alone when the person asked for it, ask first or never, and whose connection it runs on; and MCP servers an owner adds. Reading is alone, writing inside g1t follows today's choices, anything that leaves g1t asks first, and production deploys can't go above ask. The agents service enforces every level: ask first posts a card to allow or deny and parks a session until it's answered, a refusal names its rule in the transcript and the audit log, and a missing ability posts a request to owners. The agent abilities guide says how.1042 addMcpServer: (workspace, handle, viewer, input) => call("add_mcp_server", { workspace, handle, viewer, name: input.name, url: input.url }),
1043 removeMcpServer: (workspace, handle, viewer, id) => call("remove_mcp_server", { workspace, handle, viewer, id }),
1044 refreshMcpServer: (workspace, handle, viewer, id) => call("refresh_mcp_server", { workspace, handle, viewer, id }),
Chat and workspace agents: channels, DMs and named agents you talk to1045 templates: () => call("templates", {}),
Merge the workspace shell: navigation and phone shell, g1t as orchestrator, agents in roles with audience-checked reads, reactions and custom emoji, live notifications and browser push, the homepage tour (agents 0002, chat 0002)1046 builtin: (workspace, workspaceId) => call("builtin", { workspace, workspace_id: workspaceId }),
Chat and workspace agents: channels, DMs and named agents you talk to1047 deliver: (delivery) => call("deliver", delivery),
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked1048 overview: (workspace, viewer) => call("overview", { workspace, viewer }),
1049 sessions: (workspace, viewer, filter) => call("sessions", { workspace, viewer, ...(filter ?? {}) }),
1050 session: (workspace, id, viewer) => call("session", { workspace, id, viewer }),
1051 stopSession: (workspace, id, viewer) => call("stop_session", { workspace, id, viewer }),
1052 approveSession: (workspace, id, viewer, capMicros) => call("approve_session", { workspace, id, viewer, cap_micros: capMicros }),
1053 steerSession: (workspace, id, viewer, body) => call("steer_session", { workspace, id, viewer, body }),
Every agent can have its own computer. A session that needs one wakes it: a home of its own on g1t cloud, one per agent and never shared, where it runs commands, reads and writes files and keeps what it made, with each session working in its own folder under a shared home; after ten idle minutes it sleeps, its home kept as a snapshot and restored when it wakes, and Reset wipes the home while memory and artifacts stay. Its shell and files are abilities with the usual choices, Alone, Alone when asked, Ask first or Never, offered only inside sessions and never to a chat reply; every command shows on the session with its output, and the agent's new Computer tab shows the state, the disk used of the five gigabytes included, the recent commands, and Wake, Put to sleep and Reset. Machine time counts only while it is awake, on the sandbox lines of the ledger that name the agent and who asked, held to the same spend caps as the session; the disk itself costs nothing in this version. The runner gained a long-lived supervisor that answers the computer's requests inside the container, and the runner service a computer per agent that keeps its snapshot in the agent homes bucket when one is attached, and says so when none is. The REST API and the agent tool can read a computer, wake it, put it to sleep and reset it. The agents, abilities, sessions, runners, billing and deploy guides say how it works and what an operator sets up; pinning a computer to your own runner, its browser and take-over come next.1054 computer: (workspace, handle, viewer) => call("computer", { workspace, handle, viewer }),
1055 wakeComputer: (workspace, handle, viewer) => call("computer_wake", { workspace, handle, viewer }),
1056 sleepComputer: (workspace, handle, viewer) => call("computer_sleep", { workspace, handle, viewer }),
1057 resetComputer: (workspace, handle, viewer) => call("computer_reset", { workspace, handle, viewer }),
1058 computerCommands: (workspace, handle, viewer, sessionId) => call("computer_commands", { workspace, handle, viewer, session_id: sessionId ?? null }),
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked1059 memories: (workspace, handle, viewer) => call("memories", { workspace, handle, viewer }),
1060 remember: (workspace, handle, viewer, input) => call("remember", { workspace, handle, viewer, input }),
1061 updateMemory: (workspace, handle, viewer, id, changes) => call("update_memory", { workspace, handle, viewer, id, changes }),
1062 forget: (workspace, handle, viewer, id) => call("forget", { workspace, handle, viewer, id }),
1063 routines: (workspace, handle, viewer) => call("routines", { workspace, handle, viewer }),
1064 saveRoutine: (workspace, handle, viewer, input, id) => call("save_routine", { workspace, handle, viewer, input, id: id ?? null }),
1065 deleteRoutine: (workspace, handle, viewer, id) => call("delete_routine", { workspace, handle, viewer, id }),
1066 runRoutine: (workspace, handle, viewer, id) => call("run_routine", { workspace, handle, viewer, id }),
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.1067 spend: (workspace, viewer, handle, options) =>
1068 call("spend", { workspace, viewer, handle: handle ?? null, period: options?.period ?? null, person: options?.person ?? null }),
1069 personBudgets: (workspace, viewer) => call("person_budgets", { workspace, viewer }),
People and teams are front and centre: one directory of people and agents with presence, local time, titles, teams and what each owns; profiles with manager and reports and the agents they work with; an org chart with each team's agents beside the person who leads it; and teams of any mix, with a lead, a channel, a budget agents keep to and the agents on them. Every agent is told its teams each turn (who leads, who owns what, who's around and who to page), and the team page shows exactly what. Member management is Members and invites; the people and teams guide says how.1070 teamContext: (workspace, handle, viewer) => call("team_context", { workspace, handle, viewer }),
The Spend page says what a workspace spent, where it went and the budgets that hold it, in Workspace under Money: spent at price, agents' spend and the spend limit; by day; by agent, person, channel, model, kind of work and product; budgets from the workspace down to each person, agent and task, with what happens at 100%; the costliest tasks, each with a receipt of every session at the provider's price and what was charged; and how it's priced. Everyone sees what agents spent for them, and owners and billing managers the whole workspace; each person can have a monthly budget agents keep to, and the spend pill in the top bar shows your month or the workspace's against its limit. The spend guide says how.1071 setPersonBudget: (workspace, viewer, username, monthlyMicros) =>
1072 call("set_person_budget", { workspace, viewer, username, monthly_micros: monthlyMicros }),
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked1073 activity: (workspace, handle, viewer) => call("activity", { workspace, handle, viewer }),
Pricing says it plainly: models at the provider's price, the agent rate for what g1t runs around every model call (the gateway, secrets, routing, context and pass-through to your own provider, so your own keys too), everything else at cost plus 20%, your own runners free, no seats; Security and quality comes with the plan with no separate fee, and live activations end. Each agent has an effort setting, Auto to Max, with what a typical task has cost at each level, and Spend's Spend less, keep quality suggests a lower level only when the agent's own past work shows quality held, to apply or dismiss. The pricing, spend and agents guides say how.1074 effortCosts: (workspace, handle, viewer) => call("effort_costs", { workspace, handle, viewer }),
1075 recommendations: (workspace, viewer, handle) => call("recommendations", { workspace, viewer, handle: handle ?? null }),
1076 resolveRecommendation: (workspace, viewer, id, action) => call("resolve_recommendation", { workspace, viewer, id, action }),
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked1077 versions: (workspace, handle, viewer) => call("versions", { workspace, handle, viewer }),
Cards you act on in chat; agents comment and review as themselves; names shown cleanly; commits on the calendar1078 cardAction: (input) => call("card_action", input),
Agents work in sessions: bounded, visible, steerable work spun off from chat, with subagents and colleagues in a tree paid by its root; memory with sources and scopes; routines; a workspace budget for every agent; agents file issues for whoever asked1079 policy: (workspace, viewer) => call("policy", { workspace, viewer }),
1080 setPolicy: (workspace, viewer, policy) => call("set_policy", { workspace, viewer, policy }),
The Marketplace is where a workspace finds what to add, reached from Apps: the agent catalog of roles with who already does each job and Add to workspace; every integration with whether it's connected; g1t's own extensions, listed as Soon; and requests, where members ask and owners add or turn down, each told by a notification. Underneath, an extension is a manifest (publisher and tier, source and version from a tag, scopes, the domains its data goes to, its page on g1tusercontent.com, no price) and an install pins its version with an off switch, a budget and the audit log. Apps lists only what was added from the Marketplace, with pins; g1t's own pages stay in their sidebars, and AI Gateway joins Workspace's. The marketplace guide says how.1081 installRequests: (workspace, viewer) => call("install_requests", { workspace, viewer }),
1082 requestInstall: (workspace, viewer, listing, note) => call("request_install", { workspace, viewer, listing, note: note ?? null }),
1083 resolveInstallRequest: (workspace, viewer, id, status) => call("resolve_install_request", { workspace, viewer, id, status }),
1084 extensionInstalls: (workspace, viewer) => call("extension_installs", { workspace, viewer }),
1085 installExtension: (workspace, viewer, extension) => call("install_extension", { workspace, viewer, extension }),
1086 setExtensionEnabled: (workspace, viewer, listing, enabled) => call("set_extension_enabled", { workspace, viewer, listing, enabled }),
1087 setExtensionBudget: (workspace, viewer, listing, monthlyMicros) => call("set_extension_budget", { workspace, viewer, listing, monthly_micros: monthlyMicros }),
1088 uninstallExtension: (workspace, viewer, listing) => call("uninstall_extension", { workspace, viewer, listing }),
Chat and workspace agents: channels, DMs and named agents you talk to1089 };
1090}

This file's history is long; its oldest lines are credited to the oldest commit read.