Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ targets:
- name: npm
id: "@sentry/junior-cloudflare"
includeNames: /^sentry-junior-cloudflare-\d.*\.tgz$/
- name: npm
id: "@sentry/junior-conversation-classification"
includeNames: /^sentry-junior-conversation-classification-\d.*\.tgz$/
- name: npm
id: "@sentry/junior-dashboard"
includeNames: /^sentry-junior-dashboard-\d.*\.tgz$/
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ jobs:
- packages/junior-agent-browser/**
- packages/junior-amplitude/**
- packages/junior-cloudflare/**
- packages/junior-conversation-classification/**
- packages/junior-datadog/**
- packages/junior-github/**
- packages/junior-hex/**
Expand Down Expand Up @@ -213,9 +214,11 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-node-pnpm
- run: pnpm --filter @sentry/junior-conversation-classification build
Comment thread
cursor[bot] marked this conversation as resolved.
- run: pnpm --filter @sentry/junior-memory build
- run: pnpm --filter @sentry/junior-github build
- run: pnpm --filter @sentry/junior-vercel build
- run: pnpm --filter @sentry/junior-conversation-classification test
- run: pnpm --filter @sentry/junior-memory test
- run: pnpm --filter @sentry/junior-github test
- run: pnpm --filter @sentry/junior-vercel test
Expand Down Expand Up @@ -347,6 +350,7 @@ jobs:
pnpm --filter @sentry/junior-agent-browser pack --pack-destination artifacts
pnpm --filter @sentry/junior-amplitude pack --pack-destination artifacts
pnpm --filter @sentry/junior-cloudflare pack --pack-destination artifacts
pnpm --filter @sentry/junior-conversation-classification pack --pack-destination artifacts
pnpm --filter @sentry/junior-dashboard pack --pack-destination artifacts
pnpm --filter @sentry/junior-datadog pack --pack-destination artifacts
pnpm --filter @sentry/junior-github pack --pack-destination artifacts
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ This repo uses Craft for manual lockstep npm releases of:
- `@sentry/junior-agent-browser`
- `@sentry/junior-amplitude`
- `@sentry/junior-cloudflare`
- `@sentry/junior-conversation-classification`
- `@sentry/junior-dashboard`
- `@sentry/junior-datadog`
- `@sentry/junior-github`
Expand Down
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,22 @@ Start here:

## Packages

| Package | Purpose |
| ------------------------------ | ---------------------------------------------------------------------------- |
| `@sentry/junior` | Core Slack bot runtime |
| `@sentry/junior-plugin-api` | Lightweight plugin API types and helpers |
| `@sentry/junior-agent-browser` | Agent Browser plugin package for browser automation |
| `@sentry/junior-amplitude` | Read-only Amplitude product analytics through Amplitude's hosted MCP server |
| `@sentry/junior-cloudflare` | Cloudflare plugin package for production operations |
| `@sentry/junior-dashboard` | Authenticated dashboard package for Junior runtime diagnostics |
| `@sentry/junior-datadog` | Datadog plugin package for observability workflows through Datadog's Pup CLI |
| `@sentry/junior-github` | GitHub plugin package for issue workflows |
| `@sentry/junior-hex` | Hex plugin package for data warehouse query workflows |
| `@sentry/junior-linear` | Linear plugin package for issue workflows |
| `@sentry/junior-memory` | Memory plugin package for long-term Junior memory storage |
| `@sentry/junior-notion` | Notion plugin package for page search workflows |
| `@sentry/junior-scheduler` | Scheduler plugin package for scheduled Junior tasks |
| `@sentry/junior-maintenance` | Maintenance plugin package for updating and improving Junior apps |
| `@sentry/junior-sentry` | Sentry plugin package for issue workflows |
| `@sentry/junior-vercel` | Vercel plugin package for deployment monitoring and log investigations |
| Package | Purpose |
| -------------------------------------------- | ---------------------------------------------------------------------------- |
| `@sentry/junior` | Core Slack bot runtime |
| `@sentry/junior-plugin-api` | Lightweight plugin API types and helpers |
| `@sentry/junior-agent-browser` | Agent Browser plugin package for browser automation |
| `@sentry/junior-amplitude` | Read-only Amplitude product analytics through Amplitude's hosted MCP server |
| `@sentry/junior-cloudflare` | Cloudflare plugin package for production operations |
| `@sentry/junior-conversation-classification` | Per-turn requested-job classification for product analytics |
| `@sentry/junior-dashboard` | Authenticated dashboard package for Junior runtime diagnostics |
| `@sentry/junior-datadog` | Datadog plugin package for observability workflows through Datadog's Pup CLI |
| `@sentry/junior-github` | GitHub plugin package for issue workflows |
| `@sentry/junior-hex` | Hex plugin package for data warehouse query workflows |
| `@sentry/junior-linear` | Linear plugin package for issue workflows |
| `@sentry/junior-memory` | Memory plugin package for long-term Junior memory storage |
| `@sentry/junior-notion` | Notion plugin package for page search workflows |
| `@sentry/junior-scheduler` | Scheduler plugin package for scheduled Junior tasks |
| `@sentry/junior-maintenance` | Maintenance plugin package for updating and improving Junior apps |
| `@sentry/junior-sentry` | Sentry plugin package for issue workflows |
| `@sentry/junior-vercel` | Vercel plugin package for deployment monitoring and log investigations |
5 changes: 3 additions & 2 deletions apps/example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"private": true,
"type": "module",
"scripts": {
"predev": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-scheduler build",
"predev": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-conversation-classification build && pnpm --filter @sentry/junior-scheduler build",
"dev": "nitro dev",
"prebuild": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-scheduler build",
"prebuild": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-conversation-classification build && pnpm --filter @sentry/junior-scheduler build",
"build": "junior snapshot create && nitro build",
"postbuild": "node scripts/check-vercel-output.mjs",
"preview": "nitro preview",
Expand All @@ -15,6 +15,7 @@
"@sentry/junior": "workspace:*",
"@sentry/junior-agent-browser": "workspace:*",
"@sentry/junior-amplitude": "workspace:*",
"@sentry/junior-conversation-classification": "workspace:*",
"@sentry/junior-dashboard": "workspace:*",
"@sentry/junior-datadog": "workspace:*",
"@sentry/junior-github": "workspace:*",
Expand Down
2 changes: 2 additions & 0 deletions apps/example/plugins.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { defineJuniorPlugins } from "@sentry/junior";
import { createConversationClassificationPlugin } from "@sentry/junior-conversation-classification";
import { githubPlugin } from "@sentry/junior-github";
import { createMemoryPlugin } from "@sentry/junior-memory";
import { schedulerPlugin } from "@sentry/junior-scheduler";
Expand All @@ -12,6 +13,7 @@ export const plugins = defineJuniorPlugins([
"@sentry/junior-agent-browser",
"@sentry/junior-amplitude",
"@sentry/junior-datadog",
createConversationClassificationPlugin(),
githubPlugin({
botNameEnv: "GITHUB_APP_BOT_NAME",
botEmailEnv: "GITHUB_APP_BOT_EMAIL",
Expand Down
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"worktree:setup": "node scripts/worktree.mjs setup",
"cloudflare:token": "node scripts/refresh-cloudflare-tunnel-token.mjs",
"prepare": "simple-git-hooks",
"lint": "pnpm --filter @sentry/junior lint && pnpm --filter @sentry/junior-memory lint && pnpm --filter @sentry/junior-github lint && pnpm --filter @sentry/junior-vercel lint && pnpm ast-grep:lint && pnpm package:lint",
"lint": "pnpm --filter @sentry/junior lint && pnpm --filter @sentry/junior-memory lint && pnpm --filter @sentry/junior-conversation-classification lint && pnpm --filter @sentry/junior-github lint && pnpm --filter @sentry/junior-vercel lint && pnpm ast-grep:lint && pnpm package:lint",
"lint:fix": "pnpm --filter @sentry/junior lint:fix",
"ast-grep:lint": "ast-grep scan",
"lint-staged": "lint-staged",
Expand All @@ -21,17 +21,17 @@
"docs:dev": "pnpm --filter @sentry/junior-docs dev",
"docs:build": "pnpm --filter @sentry/junior-docs build",
"docs:check": "pnpm --filter @sentry/junior-docs check",
"package:lint": "for pkg in packages/junior packages/junior-plugin-api packages/junior-scheduler packages/junior-memory packages/junior-dashboard packages/junior-github packages/junior-agent-browser packages/junior-amplitude packages/junior-cloudflare packages/junior-datadog packages/junior-hex packages/junior-linear packages/junior-maintenance packages/junior-notion packages/junior-sentry packages/junior-vercel; do pnpm exec publint \"$pkg\" || exit $?; done",
"package:lint": "for pkg in packages/junior packages/junior-plugin-api packages/junior-scheduler packages/junior-memory packages/junior-conversation-classification packages/junior-dashboard packages/junior-github packages/junior-agent-browser packages/junior-amplitude packages/junior-cloudflare packages/junior-datadog packages/junior-hex packages/junior-linear packages/junior-maintenance packages/junior-notion packages/junior-sentry packages/junior-vercel; do pnpm exec publint \"$pkg\" || exit $?; done",
"release:check": "node scripts/check-release-config.mjs",
"start": "pnpm --filter @sentry/junior-example dev",
"test": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-github build && pnpm --filter @sentry/junior-vercel build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior test && pnpm --filter @sentry/junior-memory test && pnpm --filter @sentry/junior-github test && pnpm --filter @sentry/junior-vercel test && pnpm --filter @sentry/junior-dashboard test",
"test": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-conversation-classification build && pnpm --filter @sentry/junior-github build && pnpm --filter @sentry/junior-vercel build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior test && pnpm --filter @sentry/junior-memory test && pnpm --filter @sentry/junior-conversation-classification test && pnpm --filter @sentry/junior-github test && pnpm --filter @sentry/junior-vercel test && pnpm --filter @sentry/junior-dashboard test",
"test:e2e:dashboard": "pnpm --filter @sentry/junior-dashboard build && playwright test -c packages/junior-dashboard/playwright.config.ts",
"test:watch": "pnpm --filter @sentry/junior test:watch",
"evals": "pnpm --filter @sentry/junior-evals evals",
"evals:record": "pnpm --filter @sentry/junior-evals evals:record",
"typecheck": "pnpm -r run typecheck",
"skills:check": "pnpm --filter @sentry/junior skills:check",
"test:ci": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-github build && pnpm --filter @sentry/junior-vercel build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior test:coverage && pnpm --filter @sentry/junior-memory test && pnpm --filter @sentry/junior-github test && pnpm --filter @sentry/junior-vercel test && pnpm --filter @sentry/junior-dashboard test:coverage"
"test:ci": "pnpm --filter @sentry/junior build && pnpm --filter @sentry/junior-memory build && pnpm --filter @sentry/junior-conversation-classification build && pnpm --filter @sentry/junior-github build && pnpm --filter @sentry/junior-vercel build && pnpm --filter @sentry/junior-dashboard build && pnpm --filter @sentry/junior test:coverage && pnpm --filter @sentry/junior-memory test && pnpm --filter @sentry/junior-conversation-classification test && pnpm --filter @sentry/junior-github test && pnpm --filter @sentry/junior-vercel test && pnpm --filter @sentry/junior-dashboard test:coverage"
},
"simple-git-hooks": {
"pre-commit": "pnpm lint-staged"
Expand Down
9 changes: 5 additions & 4 deletions packages/docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ export default defineConfig({
label: "Cloudflare Plugin",
link: "/extend/cloudflare-plugin/",
},
{
label: "Conversation Classification Plugin",
link: "/extend/conversation-classification-plugin/",
},
{ label: "Datadog Plugin", link: "/extend/datadog-plugin/" },
{ label: "GitHub Plugin", link: "/extend/github-plugin/" },
{ label: "Hex Plugin", link: "/extend/hex-plugin/" },
Expand Down Expand Up @@ -191,10 +195,7 @@ export default defineConfig({
],
},
],
plugins: [
sentryStarlightTheme(),
sentryAgentMarkdown(),
],
plugins: [sentryStarlightTheme(), sentryAgentMarkdown()],
}),
],
markdown: {
Expand Down
1 change: 1 addition & 0 deletions packages/docs/src/content/docs/contribute/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Junior uses lockstep package releases for:
- `@sentry/junior-agent-browser`
- `@sentry/junior-amplitude`
- `@sentry/junior-cloudflare`
- `@sentry/junior-conversation-classification`
- `@sentry/junior-dashboard`
- `@sentry/junior-datadog`
- `@sentry/junior-github`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
---
title: Conversation Classification Plugin
description: Classify the primary job requested in Junior conversations for aggregate product analytics.
type: tutorial
summary: Configure asynchronous per-turn classification with a stable taxonomy and bounded retention.
prerequisites:
- /extend/
related:
- /concepts/skills-and-plugins/
- /operate/security-hardening/
- /reference/runtime-commands/
---

The conversation classification plugin records one requested-job category for
each successfully completed turn. Classification runs after visible reply
delivery and does not change the user-facing response.

## Install

```bash
pnpm add @sentry/junior-conversation-classification
```

## Register

Add the plugin factory to `plugins.ts`:

```ts title="plugins.ts"
import { defineJuniorPlugins } from "@sentry/junior";
import { createConversationClassificationPlugin } from "@sentry/junior-conversation-classification";

export const plugins = defineJuniorPlugins([
createConversationClassificationPlugin(),
]);
```

The plugin uses runtime hooks and background tasks, so do not register it as a
bare package-name string.

## Run migrations

Apply the packaged Postgres migration before serving traffic:

```bash
pnpm exec junior upgrade
```

## Configure

```ts title="plugins.ts"
createConversationClassificationPlugin({
maxTranscriptChars: 8_000,
modelId: "anthropic/claude-haiku-4.5",
retentionDays: 180,
taxonomy: {
version: "company-intent-v1",
categories: [
{
id: "engineering",
description: "Implementation, debugging, or code review work.",
},
{
id: "research",
description: "Investigation or information gathering without changes.",
},
{
id: "other",
description: "No other category is a confident fit.",
},
],
},
});
```

- `modelId` defaults to Junior's fast structured model.
- `maxTranscriptChars` defaults to `12000` and must be at least `256`.
- `retentionDays` defaults to `90` and controls plugin-owned cleanup.
- Category ids must be unique lowercase identifiers. Keep ids stable within a
version and change the version when category definitions materially change.

## Data handling

The additional structured-model request contains only authoritative user
instructions from the completed turn and tool names with success/error status.
Ambient thread context, assistant text, and tool-result bodies are excluded.
The plugin stores no transcript text.

## Verify

Run a local conversation through the configured app:

```bash
pnpm cli -- chat -p "Explain what the conversation classification plugin measures."
```

Confirm the command exits successfully and that the background task writes a
row to `junior_conversation_classifications`.

For initial-intent reporting, select the earliest `turn_completed_at_ms` row
for each `conversation_id`. Keep all rows when analyzing how requests change
within longer conversations.

## Next step

Review [Security Hardening](/operate/security-hardening/) before enabling
classification for private workplace conversations.
Loading
Loading