Pick any line to see why it is the way it is: the commit, the pull request and issue it came from, and what the agent was thinking.
| The Marketplace 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. | 1 | -- The Marketplace: members' install requests (src/installs.ts), where a |
| 2 | -- member asks the workspace's owners to add an agent from the catalog, an | |
| 3 | -- integration or an extension; and the extensions a workspace installed | |
| 4 | -- (src/extensions.ts). | |
| 5 | ||
| 6 | CREATE TABLE install_requests ( | |
| 7 | id TEXT PRIMARY KEY, | |
| 8 | -- By id, not slug: a renamed workspace keeps its requests. | |
| 9 | workspace_id TEXT NOT NULL, | |
| 10 | -- `agent:<template>`, `integration:<connector>` or `extension:<id>` (@g1t/contracts marketplace.ts). | |
| 11 | listing TEXT NOT NULL, | |
| 12 | -- The listing's name when it was asked for, so a request still reads | |
| 13 | -- after the listing changes. | |
| 14 | name TEXT NOT NULL, | |
| 15 | note TEXT, | |
| 16 | requested_by TEXT NOT NULL, | |
| 17 | requested_by_id TEXT NOT NULL, | |
| 18 | requested_at TEXT NOT NULL, | |
| 19 | -- open, done or declined. | |
| 20 | status TEXT NOT NULL DEFAULT 'open', | |
| 21 | resolved_by TEXT, | |
| 22 | resolved_at TEXT | |
| 23 | ); | |
| 24 | ||
| 25 | -- One open request per person and listing: asking twice is one request. | |
| 26 | CREATE UNIQUE INDEX install_requests_open ON install_requests (workspace_id, listing, requested_by_id) WHERE status = 'open'; | |
| 27 | CREATE INDEX install_requests_by_workspace ON install_requests (workspace_id, status, requested_at); | |
| 28 | ||
| 29 | -- Extensions installed in a workspace: which version, on which plan, who | |
| 30 | -- installed it, and whether it is switched on. An uninstalled extension | |
| 31 | -- keeps its row, with when and by whom. | |
| 32 | CREATE TABLE extension_installs ( | |
| 33 | id TEXT PRIMARY KEY, | |
| 34 | workspace_id TEXT NOT NULL, | |
| 35 | -- `extension:<id>`. | |
| 36 | listing TEXT NOT NULL, | |
| 37 | version TEXT NOT NULL, | |
| 38 | -- `free` until listings have prices. | |
| 39 | plan TEXT NOT NULL DEFAULT 'free', | |
| 40 | installed_by TEXT NOT NULL, | |
| 41 | installed_at TEXT NOT NULL, | |
| 42 | -- 1 on, 0 off: the kill switch. | |
| 43 | enabled INTEGER NOT NULL DEFAULT 1, | |
| 44 | disabled_by TEXT, | |
| 45 | disabled_at TEXT, | |
| 46 | -- A monthly cap on what it spends, in micro-dollars; null: the workspace's limit. | |
| 47 | budget_monthly_micros INTEGER, | |
| 48 | uninstalled_by TEXT, | |
| 49 | uninstalled_at TEXT | |
| 50 | ); | |
| 51 | ||
| 52 | -- One live install per workspace and extension. | |
| 53 | CREATE UNIQUE INDEX extension_installs_live ON extension_installs (workspace_id, listing) WHERE uninstalled_at IS NULL; |