Files
triggerdotdev--trigger.dev/package.json
T
Eric Allam 54d95ee4b9 feat: AI prompt management dashboard and enhanced span inspectors (#3244)
- Full prompt management UI: list, detail, override, and version
management for AI prompts defined with `prompts.define()`
- Rich AI span inspectors for all AI SDK operations with token usage,
messages, and prompt context
- Real-time generation tracking with live polling and filtering

## Prompt management

Define prompts in your code with `prompts.define()`, then manage
versions and overrides from the dashboard without redeploying:

```typescript
import { task, prompts } from "@trigger.dev/sdk";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
import { z } from "zod";

const supportPrompt = prompts.define({
  id: "customer-support",
  model: "gpt-4o",
  variables: z.object({
    customerName: z.string(),
    plan: z.string(),
    issue: z.string(),
  }),
  content: `You are a support agent for Acme SaaS.
Customer: {{customerName}} ({{plan}} plan)
Issue: {{issue}}
Respond with empathy and precision.`,
});

export const supportTask = task({
  id: "handle-support",
  run: async (payload) => {
    const resolved = await supportPrompt.resolve({
      customerName: payload.name,
      plan: payload.plan,
      issue: payload.issue,
    });

    const result = await generateText({
      model: openai(resolved.model ?? "gpt-4o"),
      system: resolved.text,
      prompt: payload.issue,
      ...resolved.toAISDKTelemetry(),
    });

    return { response: result.text };
  },
});
```

The prompts list page shows each prompt with its current version, model,
override status, and a usage sparkline over the last 24 hours.

From the prompt detail page you can:

- **Create overrides** to change the prompt template or model without
redeploying. Overrides take priority over the deployed version when
`prompt.resolve()` is called.
- **Promote** any code-deployed version to be the current version
- **Browse generations** across all versions with infinite scroll and
live polling for new results
- **Filter** by version, model, operation type, and provider
- **View metrics** (total generations, avg tokens, avg cost, latency)
broken down by version

## AI span inspectors

Every AI SDK operation now gets a custom inspector in the run trace
view:

- **`ai.generateText` / `ai.streamText`** — Shows model, token usage,
cost, the full message thread (system prompt, user message, assistant
response), and linked prompt details
- **`ai.generateObject` / `ai.streamObject`** — Same as above plus the
JSON schema and structured output
- **`ai.toolCall`** — Shows tool name, call ID, and input arguments
- **`ai.embed`** — Shows model and the text being embedded

For generation spans linked to a prompt, a "Prompt" tab shows the prompt
metadata, the input variables passed to `resolve()`, and the template
content from the prompt version.

All AI span inspectors include a compact timestamp and duration header.

## Other improvements

- Resizable panel sizes now persist across page refreshes (patched
`@window-splitter/state` to fix snapshot restoration)
- Run page panels also persist their sizes
- Fixed `<div>` inside `<p>` DOM nesting warnings in span titles and
chat messages
- Added Operations and Providers filters to the AI metrics dashboard

## Screenshots

<img width="3680" height="2392" alt="CleanShot 2026-03-21 at 10 14
17@2x"
src="https://github.com/user-attachments/assets/f3e59989-a2fa-4990-a9d0-3cacda431868"
/>

<img width="3680" height="2392" alt="CleanShot 2026-03-21 at 10 15
37@2x"
src="https://github.com/user-attachments/assets/2f2d02df-2d2b-44fb-ac6f-9153f6a6c387"
/>

<img width="3680" height="2392" alt="CleanShot 2026-03-21 at 10 15
54@2x"
src="https://github.com/user-attachments/assets/baa161e0-ef91-4fa4-a55f-986b71cccdf0"
/>
2026-03-23 06:23:19 +00:00

123 lines
4.7 KiB
JSON

{
"name": "triggerdotdev",
"private": true,
"workspaces": [
"apps/*",
"packages/*",
"integrations/*"
],
"version": "0.0.1",
"scripts": {
"build": "turbo run build",
"build:force": "turbo run build --force",
"build:db:seed": "turbo run build:db:seed",
"db:migrate": "turbo run db:migrate:deploy generate",
"db:seed": "turbo run db:seed",
"db:studio": "turbo run db:studio",
"db:populate": "turbo run db:populate",
"dev": "turbo run dev",
"i:dev": "infisical run -- turbo run dev",
"generate": "turbo run generate",
"lint": "turbo run lint",
"docker": "docker compose -p triggerdotdev-docker -f docker/docker-compose.yml up -d --build --remove-orphans",
"docker:stop": "docker compose -p triggerdotdev-docker -f docker/docker-compose.yml stop",
"dev:docker": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d --build --remove-orphans",
"dev:docker:build": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml up -d --build",
"dev:docker:stop": "docker compose -p triggerdotdev-dev-docker -f docker/dev-compose.yml stop",
"test": "turbo run test --concurrency=1 -- --run",
"test:webapp": "turbo run test --filter webapp -- --run",
"test:packages": "turbo run test --concurrency=1 --filter \"@trigger.dev/*\" -- --run",
"test:internal": "turbo run test --concurrency=1 --filter \"@internal/*\" -- --run",
"test:dev": "turbo run test:dev",
"start": "turbo run start",
"check-exports": "turbo run check-exports",
"clean": "turbo run clean",
"clean:node_modules": "find . -name 'node_modules' -type d -prune -exec rm -rf '{}' +",
"typecheck": "turbo run typecheck",
"test:e2e": "playwright test",
"test:e2e:ui": "playwright test --ui",
"test:e2e:dev": "turbo run test:e2e:dev",
"test:e2e:ci": "turbo run test:e2e:ci",
"setup": "turbo run generate db:migrate:force db:seed",
"env:pull": "turbo run env:pull",
"changeset:add": "changeset",
"changeset:version": "changeset version",
"changeset:release": "pnpm run build --filter \"@trigger.dev/*\" --filter \"trigger.dev\" && changeset publish",
"changeset:v4": "changeset pre enter v4",
"changeset:normal": "changeset pre exit",
"clean:sourcemaps": "turbo run clean:sourcemaps",
"storybook": "turbo run storybook"
},
"devDependencies": {
"@manypkg/cli": "^0.19.2",
"@playwright/test": "^1.36.2",
"@trigger.dev/database": "workspace:*",
"@types/node": "20.14.14",
"@vitest/coverage-v8": "3.1.4",
"autoprefixer": "^10.4.12",
"eslint-plugin-turbo": "^2.0.4",
"lefthook": "^1.11.3",
"pkg-types": "1.1.3",
"prettier": "^3.0.0",
"tsx": "^3.7.1",
"turbo": "^1.10.3",
"typescript": "5.5.4",
"vite": "^5.4.21",
"vite-tsconfig-paths": "^4.0.5",
"vitest": "3.1.4"
},
"packageManager": "pnpm@10.23.0",
"dependencies": {
"@changesets/cli": "2.26.2",
"@remix-run/changelog-github": "^0.0.5",
"agentcrumbs": "^0.5.0",
"node-fetch": "2.6.x"
},
"pnpm": {
"patchedDependencies": {
"@changesets/assemble-release-plan@5.2.4": "patches/@changesets__assemble-release-plan@5.2.4.patch",
"engine.io-parser@5.2.2": "patches/engine.io-parser@5.2.2.patch",
"graphile-worker@0.16.6": "patches/graphile-worker@0.16.6.patch",
"redlock@5.0.0-beta.2": "patches/redlock@5.0.0-beta.2.patch",
"@kubernetes/client-node@1.0.0": "patches/@kubernetes__client-node@1.0.0.patch",
"@sentry/remix@9.46.0": "patches/@sentry__remix@9.46.0.patch",
"@upstash/ratelimit@1.1.3": "patches/@upstash__ratelimit.patch",
"antlr4ts@0.5.0-alpha.4": "patches/antlr4ts@0.5.0-alpha.4.patch",
"@window-splitter/state@0.4.1": "patches/@window-splitter__state@0.4.1.patch"
},
"overrides": {
"typescript": "5.5.4",
"@types/node": "20.14.14",
"express@^4>body-parser": "1.20.3",
"@remix-run/dev@2.1.0>tar-fs": "2.1.3",
"testcontainers@10.28.0>tar-fs": "3.0.9",
"form-data@^2": "2.5.4",
"form-data@^3": "3.0.4",
"form-data@^4": "4.0.4",
"axios@1.9.0": ">=1.12.0",
"js-yaml@>=3.0.0 <3.14.2": "3.14.2",
"js-yaml@>=4.0.0 <4.1.1": "4.1.1",
"jws@<3.2.3": "3.2.3",
"qs@>=6.0.0 <6.14.1": "6.14.1",
"systeminformation@>=5.0.0 <5.27.14": "5.27.14",
"lodash@>=4.0.0 <4.17.23": "4.17.23"
},
"onlyBuiltDependencies": [
"@depot/cli",
"@fingerprintjs/fingerprintjs-pro-react",
"@prisma/client",
"@prisma/engines",
"@sentry/cli",
"@swc/core",
"better-sqlite3",
"cpu-features",
"esbuild",
"lefthook",
"prisma",
"protobufjs",
"sharp",
"ssh2",
"turbo"
]
}
}