Nothing declared and never read is left in the site's components and routes: unused imports, parameters and helpers go, and an allowed Ask-first call on a connector's tool finds the connector among the turn's servers, not only the agent's own. A plugin skill's origin reads as the plugin it came with.
19 files+17−340/19 viewed
| 34 | 34 | return `Drafted by @${origin.agent} from “${origin.title}”`; | |
| 35 | 35 | case "mirror": | |
| 36 | 36 | return `From ${origin.repo} at ${origin.commit.slice(0, 7)}`; | |
| 37 | + | case "plugin": | |
| 38 | + | return `From the ${origin.plugin} plugin${origin.sha ? ` at ${origin.sha.slice(0, 7)}` : ""}`; | |
| 37 | 39 | } | |
| 38 | 40 | } | |
| 39 | 41 |
| 408 | 408 | ))} | |
| 409 | 409 | ||
| 410 | 410 | {/* Lanes: a raised slab each, with an agent riding it. */} | |
| 411 | − | {lanes.map((y, index) => ( | |
| 411 | + | {lanes.map((y) => ( | |
| 412 | 412 | <g key={y}> | |
| 413 | 413 | <Box x={0} y={y} w={150} d={16} h={3} stroke="var(--color-fg)" opacity={0.22} top="var(--color-surface)" /> | |
| 414 | 414 | </g> |
| 467 | 467 | ||
| 468 | 468 | // --- Add-ons ------------------------------------------------------------------------------------ | |
| 469 | 469 | ||
| 470 | − | export function AddOns({ plan, security, owner, enabled, error }: { plan: FeatureState | null; security: FeatureState | null; owner: boolean; enabled: boolean; error?: string }) { | |
| 470 | + | export function AddOns({ plan, security, error }: { plan: FeatureState | null; security: FeatureState | null; error?: string }) { | |
| 471 | 471 | const planOn = !!plan?.on; | |
| 472 | 472 | const rows: { key: string; name: string; about: string; price: string; on: boolean; label: string; control: ReactNode }[] = []; | |
| 473 | 473 | if (security) { |
| 35 | 35 | /** An error the action returned, for the section it belongs to. */ | |
| 36 | 36 | export type SectionError = { section: string; error: string } | null | undefined; | |
| 37 | 37 | ||
| 38 | − | function errorFor(error: SectionError, section: string): string | undefined { | |
| 39 | − | return error && error.section === section ? error.error : undefined; | |
| 40 | − | } | |
| 41 | − | ||
| 42 | 38 | const CONTROL = | |
| 43 | 39 | "rounded-md border border-line bg-bg px-2.5 py-1.5 text-sm tabular-nums outline-none transition-colors placeholder:text-faint hover:border-line-strong focus:border-accent-dim"; | |
| 44 | 40 |
| 1 | − | import { type RefObject, useEffect, useRef } from "react"; | |
| 1 | + | import { type RefObject, useEffect } from "react"; | |
| 2 | 2 | ||
| 3 | 3 | /** | |
| 4 | 4 | * Keeps a conversation's newest message in view while the reader is at |
| 17 | 17 | import type { Comment, Comparison, DiffLine } from "@g1t/contracts"; | |
| 18 | 18 | ||
| 19 | 19 | import type { | |
| 20 | − | HighlightedComparison, | |
| 21 | 20 | HighlightedFile, | |
| 22 | 21 | HighlightedLine, | |
| 23 | 22 | } from "../lib/diff"; |
| 9 | 9 | ||
| 10 | 10 | import { Avatar } from "./ui/avatar"; | |
| 11 | 11 | import { Card } from "./ui/card"; | |
| 12 | − | import { Hint } from "./ui/hint"; | |
| 13 | 12 | import { Kbd } from "./ui/kbd"; | |
| 14 | 13 | import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "./ui/dialog"; | |
| 15 | 14 | import { |
| 117 | 117 | } from "./ui/collapsible"; | |
| 118 | 118 | import { | |
| 119 | 119 | Sidebar, | |
| 120 | − | SidebarContent, | |
| 121 | 120 | SidebarGroup, | |
| 122 | 121 | SidebarGroupAction, | |
| 123 | 122 | SidebarGroupContent, | |
| 124 | 123 | SidebarGroupLabel, | |
| 125 | 124 | SidebarHeader, | |
| 126 | 125 | SidebarMenu, | |
| 127 | − | SidebarMenuAction, | |
| 128 | 126 | SidebarMenuBadge, | |
| 129 | 127 | SidebarMenuButton, | |
| 130 | 128 | SidebarMenuItem, |
| 10 | 10 | ||
| 11 | 11 | const KINDS: readonly MissingKind[] = ["project", "issue", "pull", "workspace", "person", "page"]; | |
| 12 | 12 | ||
| 13 | − | /** Words for each kind, as a sentence uses them. */ | |
| 14 | − | const NOUN: Record<MissingKind, string> = { | |
| 15 | − | project: "project", | |
| 16 | − | issue: "issue", | |
| 17 | − | pull: "pull request", | |
| 18 | − | workspace: "workspace", | |
| 19 | − | person: "person", | |
| 20 | − | page: "page", | |
| 21 | − | }; | |
| 22 | − | ||
| 23 | 13 | /** Names that are pages of g1t itself, never a workspace. */ | |
| 24 | 14 | const RESERVED = new Set([ | |
| 25 | 15 | "settings", "explore", "search", "new", "u", "pricing", "avatars", "workspaces", "login", "logout", |
| 356 | 356 | setLiveViaToken(Boolean(user?.token?.website)); | |
| 357 | 357 | offerTicket("/-/live", root?.liveTicket); | |
| 358 | 358 | } | |
| 359 | − | const { pathname, search } = useLocation(); | |
| 359 | + | const { pathname } = useLocation(); | |
| 360 | 360 | // Drawn around the error page too: a 404 keeps the sidebar out of a | |
| 361 | 361 | // project or workspace the viewer cannot see. | |
| 362 | 362 | const error = useRouteError(); |
| 1 | 1 | import { ArrowUpRight } from "lucide-react"; | |
| 2 | 2 | ||
| 3 | − | import { type FeaturePlan, type FreeTier, MICROS_PER_DOLLAR, type Price } from "@g1t/contracts"; | |
| 3 | + | import type { FeaturePlan, FreeTier, Price } from "@g1t/contracts"; | |
| 4 | 4 | ||
| 5 | 5 | import type { Route } from "./+types/pricing"; | |
| 6 | 6 | import { money as sum, wholeDollars } from "../lib/money"; |
| 1 | 1 | import { Box, CircleAlert, MailOpen } from "lucide-react"; | |
| 2 | − | import { Form, data, redirect } from "react-router"; | |
| 2 | + | import { Form, redirect } from "react-router"; | |
| 3 | 3 | ||
| 4 | 4 | import { REPO_ROLE_LABELS, REPO_ROLE_SUMMARIES } from "@g1t/contracts"; | |
| 5 | 5 |
| 1 | 1 | import { env } from "cloudflare:workers"; | |
| 2 | − | import { Bot, ExternalLink, GitCommitHorizontal, GitMerge, Play, Sparkles } from "lucide-react"; | |
| 2 | + | import { Bot, ExternalLink, GitCommitHorizontal, GitMerge, Sparkles } from "lucide-react"; | |
| 3 | 3 | import { Form, Link, redirect } from "react-router"; | |
| 4 | 4 | ||
| 5 | 5 | import { type Pull, PROVIDERS, workOwner } from "@g1t/contracts"; | |
| ⋯ | |||
| 24 | 24 | import { LabelChip, LabelsBox, MilestoneBox } from "../../components/labels"; | |
| 25 | 25 | import { | |
| 26 | 26 | Assignee, | |
| 27 | − | AssigneeStack, | |
| 28 | 27 | ChangeSize, | |
| 29 | 28 | CommentForm, | |
| 30 | 29 | CommentList, | |
| 1 | 1 | import { env } from "cloudflare:workers"; | |
| 2 | 2 | import type { G1tEvent } from "@g1t/contracts"; | |
| 3 | 3 | import { ArrowRight, CircleCheck, FileCode2, Sparkles } from "lucide-react"; | |
| 4 | − | import { Form, Link, data } from "react-router"; | |
| 4 | + | import { Form, Link } from "react-router"; | |
| 5 | 5 | ||
| 6 | 6 | import type { Route } from "./+types/plan"; | |
| 7 | 7 | import { refusal, requireRepo, requireWritableRepo } from "../../lib/access.server"; |
| 95 | 95 | {editing ? ( | |
| 96 | 96 | <EnvironmentEditor key={editing.name} environment={editing} base={base} saved={actionData?.saved ?? false} error={actionData?.error} /> | |
| 97 | 97 | ) : ( | |
| 98 | − | <EnvironmentList environments={environments} base={base} badName={badName} /> | |
| 98 | + | <EnvironmentList environments={environments} badName={badName} /> | |
| 99 | 99 | )} | |
| 100 | 100 | </div> | |
| 101 | 101 | ); | |
| 102 | 102 | } | |
| 103 | 103 | ||
| 104 | − | function EnvironmentList({ environments, base, badName }: { environments: Environment[]; base: string; badName: string | null }) { | |
| 104 | + | function EnvironmentList({ environments, badName }: { environments: Environment[]; badName: string | null }) { | |
| 105 | 105 | return ( | |
| 106 | 106 | <div className="max-w-4xl space-y-8"> | |
| 107 | 107 | <p className="max-w-3xl text-sm text-muted"> |
| 371 | 371 | ||
| 372 | 372 | {paying && <OverageCard requests={requests} owner={owner} error={err("overage")} />} | |
| 373 | 373 | ||
| 374 | − | <AddOns plan={plan} security={securityPlan} owner={owner} enabled={status.enabled} error={err("security")} /> | |
| 374 | + | <AddOns plan={plan} security={securityPlan} error={err("security")} /> | |
| 375 | 375 | ||
| 376 | 376 | {status.enabled && ( | |
| 377 | 377 | <Suspense fallback={<StripeSkeleton />}> |
| 1 | 1 | import { ArrowRight } from "lucide-react"; | |
| 2 | 2 | import { Suspense, useEffect, useState } from "react"; | |
| 3 | − | import { Await, Form, Link, data, redirect, useNavigation } from "react-router"; | |
| 3 | + | import { Await, Form, data, redirect, useNavigation } from "react-router"; | |
| 4 | 4 | ||
| 5 | 5 | import { hasCodeAccess } from "@g1t/contracts"; | |
| 6 | 6 |
| 1 | 1 | import { ArrowRight, ArrowUpRight, Box, CircleDot, GitBranch, GitPullRequest, KeyRound, Lock, Pin, Plus, Rocket } from "lucide-react"; | |
| 2 | 2 | import { Link, redirect } from "react-router"; | |
| 3 | 3 | ||
| 4 | − | import type { PackageSummary, Project, ProjectDeploys, User } from "@g1t/contracts"; | |
| 4 | + | import type { PackageSummary, Project, ProjectDeploys } from "@g1t/contracts"; | |
| 5 | 5 | ||
| 6 | 6 | import type { Route } from "./+types/overview"; | |
| 7 | 7 | import { DeployLink, host, StatusDot } from "../../components/deploy"; |
| 13 | 13 | * (cards.ts). Every refusal names its rule in the transcript, through the | |
| 14 | 14 | * tool's result, and in the audit log, through `refused`. | |
| 15 | 15 | */ | |
| 16 | − | import { type Ability, type AbilitySection, type AbilitySource, type McpServer, type MessageCard, type ServiceBinding, type User, chatClient, identityClient, integrationsClient, newId, notifyClient } from "@g1t/contracts"; | |
| 16 | + | import { type AbilitySection, type McpServer, type MessageCard, type ServiceBinding, type User, chatClient, identityClient, integrationsClient, newId, notifyClient } from "@g1t/contracts"; | |
| 17 | 17 | ||
| 18 | 18 | import { CONNECTORS, connectorPath, connectorView } from "../../../packages/contracts/src/connectors.ts"; | |
| 19 | 19 | import { findAbility, resolveAbilities } from "../../../packages/contracts/src/abilities.ts"; | |
| ⋯ | |||
| 387 | 387 | default: { | |
| 388 | 388 | // An MCP tool: `<server>__<tool>`. | |
| 389 | 389 | const [, serverId, ...rest] = request.ability.split(":"); | |
| 390 | − | const server = (definition.abilities.mcp_servers ?? []).find((s: McpServer) => s.id === serverId); | |
| 390 | + | const server = servers.find((s: McpServer) => s.id === serverId); | |
| 391 | 391 | const tool = server?.tools.find((t) => t.name === rest.join(":")); | |
| 392 | 392 | if (!server || !tool) return { ok: false, message: "That MCP tool is no longer there." }; | |
| 393 | 393 | const done = await ports.mcp(server, tool, args); | |
Comments
Sign in to comment.