@guren/plugin-ai has 1,720 recorded weekly downloads on npm, a decrease of 2.8% over the past 30 days, ranking #1933 of 3,247 tracked listings.
About @guren/plugin-ai
@guren/plugin-ai
In-process AI agents for Guren applications (RFC 0029), on the Vercel AI SDK. An Agent calls a model configured in config/ai.ts and reaches the application only through appTools(), which runs every tool call through the same invocation pipeline as the App MCP endpoint: scopes, the route's policies, approvals, redaction and the audit trail.
bun add @guren/plugin-ai @ai-sdk/anthropic
// config/ai.ts
import { defineAiConfig } from '@guren/plugin-ai'
import { createAnthropic } from '@ai-sdk/anthropic'
export default defineAiConfig((env) => ({
default: 'anthropic',
providers: {
anthropic: { model: () => createAnthropic({ apiKey: env.ANTHROPIC_API_KEY })('claude-opus-5-5') },
},
}))
// src/app.ts
createApp({ config: [ai], providers: [aiPlugin()] })
// app/Ai/Agents/SupportTriager.ts
import { Agent, Output } from '@guren/plugin-ai'
export class SupportTriager extends Agent<typeof SupportTriager.scopes> {
static override agentName = 'support-triager'
static override scopes = ['tool:tickets_show', 'tool:tickets_update'] as const
instructions = 'You triage support tickets. Read before you write.'
output = Output.object({ schema: Triage })
override tools() {
return this.appTools(['tickets_show', 'tickets_update'])
}
}
// In a controller: the container-bound form
const user = await this.auth.userOrFail<{ id: number }>()
const response = await this.make('ai').agent(SupportTriager).as(user).prompt('Ticket #4812: ...')
With guren codegen run, .guren/agents.gen.ts types appTools(): a name no route derives is a compile error, each tool's input and result are typed from its route contract, and the Agent<typeof SupportTriager.scopes> parameter makes a name missing from a tool: entry in scopes one too. A prefix grant (tools:tickets.*) is checked when as() constructs the agent.
A tool defined with tool() inside tools() runs with whatever authority its closure has, and nothing gates or audits it. Anything a route already does belongs in appTools().
settings sends AI SDK call settings with every model call (maxOutputTokens, providerOptions such as Anthropic's effort or cacheControl). continueWhen = isPausedTurn lets prompt() resume a turn Anthropic paused with pause_turn during server-side web search, up to maxContinuations (5) extra calls. A response carries sources, providerMetadata, modelId and rawFinishReason beside text, output, steps and usage, and computeCostUsd(usageOf(response), pricing) prices it, server-side tool calls included through pricing.perThousandRequests.
Tool names reach the model provider verbatim. Anthropic and OpenAI accept only [A-Za-z0-9_-]{1,64}, so a route named tickets.show needs .agent({ toolName: 'tickets_show' }).
In tests, app.fakeAi() from @guren/testing scripts the model per agent while the tools still run through the pipeline. It needs ai installed beside @guren/plugin-ai, since the fake is built on MockLanguageModelV4 from ai/test:
using ai = app.fakeAi()
ai.respond(SupportTriager, [
{ toolCalls: [{ name: 'tickets_show', input: { id: 4812 } }], then: { output: { category: 'billing', priority: 2 } } },
])
await app.post('/tickets/4812/triage').assertRedirect('/tickets/4812')
ai.assertPrompted(SupportTriager, (input) => input.includes('#4812'))
ai.calls(SupportTriager)[0].toolCalls // [{ name: 'tickets_show', input, output }]
A prompt with nothing scripted fails when ai is disposed, naming the agent, even if the route turned the error into a 500.
Requires Node 22 or later (the AI SDK's floor), or Bun.
Description from the npm listing.
- guren
- bun
- typescript
- fullstack
- framework
- ai
- ai-agents
- ai-sdk
- llm
README badge
Show your rank in a README or on your website. The badge updates automatically.
Charts
Images: 30d · 1y · all time · 1600×900 dark
Adoption over time
7/30/90-day growth
Ranking history
Listing placement
Listing placement
Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.
Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.
Recent observations
Full history (170)Similar npm AI SDKs plugins
All 20 @guren/plugin-ai alternativesData source
Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.
Listing: https://www.npmjs.com/package/@guren/plugin-ai. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.