feat(phase-4): WS2 + WS3 — Developer Portal (Next.js 14) and CLI tool (sentryagent)

WS2: Developer Portal (portal/)
- Standalone Next.js 14 + Tailwind CSS app — independent deployment
- Home page: hero, feature grid, CTA to /get-started
- /pricing: free tier limits table (10 agents, 1k calls/day) + paid tier CTA
- /sdks: all 4 SDKs (Node.js, Python, Go, Java) with install + code examples
- /api-explorer: Swagger UI from NEXT_PUBLIC_API_URL/openapi.json, persistAuthorization
- /get-started: 4-step wizard (setup → register agent → credentials → SDK snippet)
- Shared Nav component with active-link highlighting
- Build: 8/8 static pages, zero TypeScript errors

WS3: CLI Tool (cli/ — npm package: sentryagent)
- configure, register-agent, list-agents, issue-token, rotate-credentials, tail-audit-log
- Auto OAuth2 token fetch + 30s-buffer cache via client_credentials flow
- chalk-formatted table output, confirmation prompts, bounded audit log dedup
- bash + zsh shell completion scripts
- README with installation, all commands, and completion setup
- Build: tsc clean, node dist/index.js --help verified

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
SentryAgent.ai Developer
2026-04-02 04:29:50 +00:00
parent 1b682c22b2
commit d1e6af25aa
147 changed files with 8079 additions and 29 deletions

194
portal/app/sdks/page.tsx Normal file
View File

@@ -0,0 +1,194 @@
import type React from 'react';
interface Sdk {
name: string;
language: string;
badge: string;
installCmd: string;
codeExample: string;
repoUrl: string;
}
const sdks: Sdk[] = [
{
name: 'Node.js SDK',
language: 'typescript',
badge: 'TypeScript',
installCmd: 'npm install @sentryagent/idp-sdk',
codeExample: `import { AgentIdPClient } from '@sentryagent/idp-sdk';
const client = new AgentIdPClient({
apiUrl: process.env.AGENTIDP_URL!,
clientId: process.env.AGENTIDP_CLIENT_ID!,
clientSecret: process.env.AGENTIDP_CLIENT_SECRET!,
});
// Register a new agent
const agent = await client.agents.register({
name: 'my-ai-agent',
description: 'Production summarisation agent',
});
console.log('Agent ID:', agent.agentId);
// Issue an access token
const { accessToken } = await client.tokens.issue(agent.agentId);
console.log('Token:', accessToken);`,
repoUrl: 'https://github.com/sentryagent/sdk-node',
},
{
name: 'Python SDK',
language: 'python',
badge: 'Python',
installCmd: 'pip install sentryagent-idp',
codeExample: `from sentryagent_idp import AgentIdPClient
client = AgentIdPClient(
api_url=os.environ["AGENTIDP_URL"],
client_id=os.environ["AGENTIDP_CLIENT_ID"],
client_secret=os.environ["AGENTIDP_CLIENT_SECRET"],
)
# Register a new agent
agent = client.agents.register(
name="my-ai-agent",
description="Production summarisation agent",
)
print("Agent ID:", agent.agent_id)
# Issue an access token
token_response = client.tokens.issue(agent.agent_id)
print("Token:", token_response.access_token)`,
repoUrl: 'https://github.com/sentryagent/sdk-python',
},
{
name: 'Go SDK',
language: 'go',
badge: 'Go',
installCmd: 'go get github.com/sentryagent/idp-sdk-go',
codeExample: `import (
"fmt"
"os"
idp "github.com/sentryagent/idp-sdk-go"
)
client := idp.NewClient(idp.Config{
APIURL: os.Getenv("AGENTIDP_URL"),
ClientID: os.Getenv("AGENTIDP_CLIENT_ID"),
ClientSecret: os.Getenv("AGENTIDP_CLIENT_SECRET"),
})
// Register a new agent
agent, err := client.Agents.Register(ctx, &idp.RegisterAgentInput{
Name: "my-ai-agent",
Description: "Production summarisation agent",
})
if err != nil {
panic(err)
}
fmt.Println("Agent ID:", agent.AgentID)
// Issue an access token
token, err := client.Tokens.Issue(ctx, agent.AgentID)
fmt.Println("Token:", token.AccessToken)`,
repoUrl: 'https://github.com/sentryagent/sdk-go',
},
{
name: 'Java SDK',
language: 'java',
badge: 'Java',
installCmd: `<dependency>
<groupId>ai.sentryagent</groupId>
<artifactId>idp-sdk</artifactId>
<version>1.0.0</version>
</dependency>`,
codeExample: `import ai.sentryagent.idp.AgentIdPClient;
import ai.sentryagent.idp.model.Agent;
import ai.sentryagent.idp.model.TokenResponse;
AgentIdPClient client = AgentIdPClient.builder()
.apiUrl(System.getenv("AGENTIDP_URL"))
.clientId(System.getenv("AGENTIDP_CLIENT_ID"))
.clientSecret(System.getenv("AGENTIDP_CLIENT_SECRET"))
.build();
// Register a new agent
Agent agent = client.agents().register(
RegisterAgentRequest.builder()
.name("my-ai-agent")
.description("Production summarisation agent")
.build()
);
System.out.println("Agent ID: " + agent.getAgentId());
// Issue an access token
TokenResponse token = client.tokens().issue(agent.getAgentId());
System.out.println("Token: " + token.getAccessToken());`,
repoUrl: 'https://github.com/sentryagent/sdk-java',
},
];
export default function SdksPage(): React.ReactElement {
return (
<div className="px-6 py-20">
<div className="mx-auto max-w-5xl">
<div className="mb-12 text-center">
<h1 className="mb-4 text-4xl font-extrabold text-slate-900">
Official SDKs
</h1>
<p className="text-xl text-slate-600">
Native libraries for your language of choice. Every SDK is
type-safe, fully tested, and maintained by the SentryAgent team.
</p>
</div>
<div className="space-y-10">
{sdks.map((sdk) => (
<div
key={sdk.name}
className="rounded-2xl border border-slate-200 bg-white p-8 shadow-sm"
>
<div className="mb-6 flex items-center justify-between">
<div className="flex items-center gap-3">
<h2 className="text-2xl font-bold text-slate-900">
{sdk.name}
</h2>
<span className="rounded-full bg-brand-100 px-3 py-0.5 text-sm font-semibold text-brand-700">
{sdk.badge}
</span>
</div>
<a
href={sdk.repoUrl}
target="_blank"
rel="noopener noreferrer"
className="text-sm font-medium text-brand-600 hover:underline"
>
View on GitHub &rarr;
</a>
</div>
<div className="mb-6">
<p className="mb-2 text-sm font-semibold uppercase tracking-wider text-slate-500">
Installation
</p>
<pre className="overflow-x-auto rounded-lg bg-slate-900 px-4 py-3 text-sm text-slate-100">
<code>{sdk.installCmd}</code>
</pre>
</div>
<div>
<p className="mb-2 text-sm font-semibold uppercase tracking-wider text-slate-500">
Quick Start
</p>
<pre className="overflow-x-auto rounded-lg bg-slate-900 px-4 py-4 text-sm leading-relaxed text-slate-100">
<code>{sdk.codeExample}</code>
</pre>
</div>
</div>
))}
</div>
</div>
</div>
);
}