Skip to content

Commit 01e4cb3

Browse files
committed
chore: fmt
1 parent 2791683 commit 01e4cb3

9 files changed

Lines changed: 68 additions & 75 deletions

File tree

examples/gmail-proxy/app/dashboard/agents/page.tsx

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,12 @@ export default function AgentsPage() {
463463
const handleRevokeAll = async () => {
464464
const activeAgents = agents.filter((a) => a.status === "active");
465465
if (activeAgents.length === 0) return;
466-
if (!window.confirm(`Revoke all ${activeAgents.length} active agent${activeAgents.length !== 1 ? "s" : ""}? This cannot be undone.`)) return;
466+
if (
467+
!window.confirm(
468+
`Revoke all ${activeAgents.length} active agent${activeAgents.length !== 1 ? "s" : ""}? This cannot be undone.`,
469+
)
470+
)
471+
return;
467472
setRevokingAll(true);
468473
try {
469474
await Promise.all(
@@ -510,21 +515,21 @@ export default function AgentsPage() {
510515
{revokingAll ? "Revoking..." : "Revoke All"}
511516
</button>
512517
)}
513-
<div className="flex gap-0.5 rounded-lg border border-gray-200 bg-white p-0.5">
514-
{filters.map((f) => (
515-
<button
516-
key={f}
517-
onClick={() => setFilter(f)}
518-
className={`cursor-pointer rounded-md px-3 py-1 text-[12px] font-medium capitalize transition-all ${
519-
filter === f
520-
? "bg-gray-900 text-white"
521-
: "text-gray-500 hover:text-gray-700 hover:bg-gray-50"
522-
}`}
523-
>
524-
{f}
525-
</button>
526-
))}
527-
</div>
518+
<div className="flex gap-0.5 rounded-lg border border-gray-200 bg-white p-0.5">
519+
{filters.map((f) => (
520+
<button
521+
key={f}
522+
onClick={() => setFilter(f)}
523+
className={`cursor-pointer rounded-md px-3 py-1 text-[12px] font-medium capitalize transition-all ${
524+
filter === f
525+
? "bg-gray-900 text-white"
526+
: "text-gray-500 hover:text-gray-700 hover:bg-gray-50"
527+
}`}
528+
>
529+
{f}
530+
</button>
531+
))}
532+
</div>
528533
</div>
529534
</div>
530535

examples/gmail-proxy/app/dashboard/hosts/page.tsx

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,12 @@ export default function HostsPage() {
141141
const handleRevokeAll = async () => {
142142
const activeHosts = hosts.filter((h) => h.status === "active");
143143
if (activeHosts.length === 0) return;
144-
if (!window.confirm(`Revoke all ${activeHosts.length} active host${activeHosts.length !== 1 ? "s" : ""} and their agents? This cannot be undone.`)) return;
144+
if (
145+
!window.confirm(
146+
`Revoke all ${activeHosts.length} active host${activeHosts.length !== 1 ? "s" : ""} and their agents? This cannot be undone.`,
147+
)
148+
)
149+
return;
145150
setRevokingAll(true);
146151
try {
147152
await Promise.all(
@@ -185,21 +190,21 @@ export default function HostsPage() {
185190
{revokingAll ? "Revoking..." : "Revoke All"}
186191
</button>
187192
)}
188-
<div className="flex gap-0.5 rounded-full border border-border bg-white p-0.5 shadow-sm">
189-
{filters.map((f) => (
190-
<button
191-
key={f}
192-
onClick={() => setFilter(f)}
193-
className={`cursor-pointer rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${
194-
filter === f
195-
? "bg-accent text-white shadow-sm"
196-
: "text-muted hover:text-foreground hover:bg-surface"
197-
}`}
198-
>
199-
{f === "pending_enrollment" ? "enrolling" : f}
200-
</button>
201-
))}
202-
</div>
193+
<div className="flex gap-0.5 rounded-full border border-border bg-white p-0.5 shadow-sm">
194+
{filters.map((f) => (
195+
<button
196+
key={f}
197+
onClick={() => setFilter(f)}
198+
className={`cursor-pointer rounded-full px-3 py-1.5 text-xs font-medium transition-colors ${
199+
filter === f
200+
? "bg-accent text-white shadow-sm"
201+
: "text-muted hover:text-foreground hover:bg-surface"
202+
}`}
203+
>
204+
{f === "pending_enrollment" ? "enrolling" : f}
205+
</button>
206+
))}
207+
</div>
203208
</div>
204209
</div>
205210

examples/gmail-proxy/app/dashboard/settings/page.tsx

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,7 @@ function DefaultHostCapabilitiesEditor({
348348
value: string[] | null;
349349
onChange: (caps: string[]) => void;
350350
}) {
351-
const [availableCaps, setAvailableCaps] = useState<
352-
{ name: string; description: string }[]
353-
>([]);
351+
const [availableCaps, setAvailableCaps] = useState<{ name: string; description: string }[]>([]);
354352
const [loading, setLoading] = useState(false);
355353
const [editing, setEditing] = useState(false);
356354
const [selected, setSelected] = useState<Set<string>>(new Set());
@@ -407,11 +405,7 @@ function DefaultHostCapabilitiesEditor({
407405
<div className="mt-4">
408406
{loading ? (
409407
<div className="flex justify-center py-6">
410-
<svg
411-
className="animate-spin h-5 w-5 text-muted"
412-
viewBox="0 0 24 24"
413-
fill="none"
414-
>
408+
<svg className="animate-spin h-5 w-5 text-muted" viewBox="0 0 24 24" fill="none">
415409
<circle
416410
className="opacity-25"
417411
cx="12"
@@ -444,9 +438,7 @@ function DefaultHostCapabilitiesEditor({
444438
}
445439
className="rounded-full border border-border px-2.5 py-1 text-[11px] font-medium text-muted transition-colors hover:text-foreground"
446440
>
447-
{selected.size === availableCaps.length
448-
? "Deselect all"
449-
: "Select all"}
441+
{selected.size === availableCaps.length ? "Deselect all" : "Select all"}
450442
</button>
451443
</div>
452444
<div className="space-y-1 max-h-64 overflow-y-auto">
@@ -479,9 +471,7 @@ function DefaultHostCapabilitiesEditor({
479471
{cap.name}
480472
</code>
481473
{cap.description && (
482-
<p className="text-[11px] text-muted truncate">
483-
{cap.description}
484-
</p>
474+
<p className="text-[11px] text-muted truncate">{cap.description}</p>
485475
)}
486476
</div>
487477
</label>

examples/gmail-proxy/lib/auth.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,6 @@ const capabilities: Capability[] = [
388388
},
389389
];
390390

391-
392391
function sanitizeMimeHeader(value: string): string {
393392
return value.replace(/[\r\n]+/g, " ").trim();
394393
}

packages/cli/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ export function createClient(config: ClientConfig = {}): AgentAuthClient {
2424
return new AgentAuthClient({
2525
storage,
2626
urls: config.urls,
27-
directoryUrl: urlMode ? undefined : (config.directoryUrl ?? process.env.AGENT_AUTH_DIRECTORY_URL),
27+
directoryUrl: urlMode
28+
? undefined
29+
: (config.directoryUrl ?? process.env.AGENT_AUTH_DIRECTORY_URL),
2830
hostName: config.hostName ?? process.env.AGENT_AUTH_HOST_NAME,
2931
providers: config.providers as any,
3032
onApprovalRequired(info) {

packages/sdk/src/client.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,7 @@ export class AgentAuthClient {
7878
: urlMode
7979
? null
8080
: "https://agent-auth.directory";
81-
this.allowDirectDiscovery =
82-
opts.allowDirectDiscovery ?? (urlMode ? true : !this.directoryUrl);
81+
this.allowDirectDiscovery = opts.allowDirectDiscovery ?? (urlMode ? true : !this.directoryUrl);
8382
this.jwtExpirySeconds = opts.jwtExpirySeconds ?? 60;
8483
this.hostName = opts.hostName ?? detectHostName();
8584
this.onApprovalRequired = opts.onApprovalRequired ?? null;
@@ -101,9 +100,7 @@ export class AgentAuthClient {
101100
*/
102101
async init(): Promise<ProviderConfig[]> {
103102
if (!this.urls?.length) return [];
104-
const results = await Promise.allSettled(
105-
this.urls.map((url) => this.discoverProvider(url)),
106-
);
103+
const results = await Promise.allSettled(this.urls.map((url) => this.discoverProvider(url)));
107104
const configs: ProviderConfig[] = [];
108105
for (const r of results) {
109106
if (r.status === "fulfilled") {
@@ -1269,7 +1266,6 @@ export class AgentAuthClient {
12691266
const byIssuer = await this.storage.getProviderConfig(providerOrUrl);
12701267
if (byIssuer) return byIssuer;
12711268

1272-
// Search by provider_name across all cached configs
12731269
const all = await this.storage.listProviderConfigs();
12741270
const byName = all.find((c) => c.provider_name === providerOrUrl);
12751271
if (byName) return byName;

packages/sdk/src/instructions.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ Before making raw HTTP requests, using other integrations, or writing custom cod
2727
- **Use filters.** When calling execute_capability for list/search operations, translate the user's intent into the capability's filter arguments (date ranges, search terms, labels, etc.).
2828
- **Batch when possible.** Use batch_execute_capabilities instead of calling execute_capability repeatedly for multiple inputs.
2929
- **describe_capability is optional.** Skip it if you already know the arguments — the server validates and returns descriptive errors.
30+
- **Provider = issuer URL or name.** The \`provider\` field is the issuer URL from list_providers (e.g. \`http://localhost:3000/api/auth\`) or the provider name. Do NOT append URL fragments (\`#service-name\`) or extra path segments to target a specific service — use the \`capabilities\` array instead. Multiple services on the same provider share one issuer URL.
3031
`;

packages/sdk/src/kv-storage.ts

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
1-
import type {
2-
AgentConnection,
3-
HostIdentity,
4-
ProviderConfig,
5-
Storage,
6-
} from "./types";
1+
import type { AgentConnection, HostIdentity, ProviderConfig, Storage } from "./types";
72

83
/**
94
* Minimal key-value store interface.
@@ -123,16 +118,12 @@ export class KVStorage implements Storage {
123118

124119
async listAgentConnections(): Promise<AgentConnection[]> {
125120
const ids = await this.getIndex(this.k("agents"));
126-
const results = await Promise.all(
127-
ids.map((id) => this.getAgentConnection(id)),
128-
);
121+
const results = await Promise.all(ids.map((id) => this.getAgentConnection(id)));
129122
return results.filter((c): c is AgentConnection => c !== null);
130123
}
131124

132125
async getProviderConfig(issuer: string): Promise<ProviderConfig | null> {
133-
return this.getJSON<ProviderConfig>(
134-
this.k("provider", encodeURIComponent(issuer)),
135-
);
126+
return this.getJSON<ProviderConfig>(this.k("provider", encodeURIComponent(issuer)));
136127
}
137128

138129
async setProviderConfig(issuer: string, config: ProviderConfig): Promise<void> {
@@ -142,9 +133,7 @@ export class KVStorage implements Storage {
142133

143134
async listProviderConfigs(): Promise<ProviderConfig[]> {
144135
const issuers = await this.getIndex(this.k("providers"));
145-
const results = await Promise.all(
146-
issuers.map((issuer) => this.getProviderConfig(issuer)),
147-
);
136+
const results = await Promise.all(issuers.map((issuer) => this.getProviderConfig(issuer)));
148137
return results.filter((c): c is ProviderConfig => c !== null);
149138
}
150139
}

packages/sdk/src/tools.ts

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
129129
properties: {
130130
url: {
131131
type: "string",
132-
description: "Service URL or domain to look up (e.g. https://api.example.com)",
132+
description:
133+
"Service URL or domain to look up (e.g. https://api.example.com). Do NOT append fragments (#...) to the URL.",
133134
},
134135
},
135136
required: ["url"],
@@ -149,7 +150,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
149150
properties: {
150151
provider: {
151152
type: "string",
152-
description: "Provider URL, issuer, or name",
153+
description:
154+
"Provider issuer URL, name, or issuer string from list_providers. Do NOT append fragments (#...) to the URL.",
153155
},
154156
query: {
155157
type: "string",
@@ -191,7 +193,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
191193
properties: {
192194
provider: {
193195
type: "string",
194-
description: "Provider URL, issuer, or name",
196+
description:
197+
"Provider issuer URL, name, or issuer string from list_providers. Do NOT append fragments (#...) to the URL.",
195198
},
196199
name: {
197200
type: "string",
@@ -225,7 +228,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
225228
properties: {
226229
provider: {
227230
type: "string",
228-
description: "Provider URL, issuer, or name",
231+
description:
232+
"Provider issuer URL, name, or issuer string from list_providers. Do NOT append fragments (#...) to the URL.",
229233
},
230234
capabilities: {
231235
type: "array",
@@ -606,7 +610,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
606610
properties: {
607611
provider: {
608612
type: "string",
609-
description: "Provider URL, issuer, or name",
613+
description:
614+
"Provider issuer URL, name, or issuer string from list_providers. Do NOT append fragments (#...) to the URL.",
610615
},
611616
enrollment_token: {
612617
type: "string",
@@ -638,7 +643,8 @@ export function getAgentAuthTools(client: AgentAuthClient): AgentAuthTool[] {
638643
properties: {
639644
provider: {
640645
type: "string",
641-
description: "Provider URL, issuer, or name",
646+
description:
647+
"Provider issuer URL, name, or issuer string from list_providers. Do NOT append fragments (#...) to the URL.",
642648
},
643649
agent_id: {
644650
type: "string",

0 commit comments

Comments
 (0)