@cursor/july 0.1.53 → 0.1.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (111) hide show
  1. package/AGENTS.md +12 -0
  2. package/dist/channels/slack/manifest.d.ts +5 -3
  3. package/dist/channels/slack/manifest.d.ts.map +1 -1
  4. package/dist/channels/slack/manifest.js +7 -3
  5. package/dist/docs/404.html +2 -2
  6. package/dist/docs/ab.html +3 -3
  7. package/dist/docs/assets/{app.DAKcDclS.js → app.CVQxhV85.js} +1 -1
  8. package/dist/docs/assets/chunks/@localSearchIndexroot.BFpWSo6D.js +1 -0
  9. package/dist/docs/assets/chunks/{VPLocalSearchBox.BNIaCSfG.js → VPLocalSearchBox.QAPzJjql.js} +1 -1
  10. package/dist/docs/assets/chunks/{theme.B47GzJjc.js → theme.CSxTCOFu.js} +2 -2
  11. package/dist/docs/assets/{reference_cli.md.-V6J7Cl8.js → reference_cli.md.D_CCfG8R.js} +2 -0
  12. package/dist/docs/assets/templates_triage.md.DWuQ1bZz.js +9 -0
  13. package/dist/docs/assets/templates_triage.md.DWuQ1bZz.lean.js +1 -0
  14. package/dist/docs/building-with-agents.html +3 -3
  15. package/dist/docs/concepts.html +3 -3
  16. package/dist/docs/deployment.html +3 -3
  17. package/dist/docs/evals.html +3 -3
  18. package/dist/docs/example-agents/approval-buddy.html +3 -3
  19. package/dist/docs/example-agents/benny.html +3 -3
  20. package/dist/docs/example-agents/bugbot.html +3 -3
  21. package/dist/docs/example-agents/codebase-wiki.html +3 -3
  22. package/dist/docs/example-agents/codeowners-review.html +3 -3
  23. package/dist/docs/example-agents/concierge.html +3 -3
  24. package/dist/docs/example-agents/fsd.html +3 -3
  25. package/dist/docs/example-agents/index.html +3 -3
  26. package/dist/docs/example-agents/knowledge-base.html +3 -3
  27. package/dist/docs/example-agents/oncall.html +3 -3
  28. package/dist/docs/example-agents/security-reviewer.html +3 -3
  29. package/dist/docs/example-agents/slack-agent.html +3 -3
  30. package/dist/docs/example-agents/weather-agent.html +3 -3
  31. package/dist/docs/guides/agent-to-agent.html +3 -3
  32. package/dist/docs/guides/cloud-runtime.html +3 -3
  33. package/dist/docs/guides/github.html +3 -3
  34. package/dist/docs/guides/human-in-the-loop.html +3 -3
  35. package/dist/docs/guides/mcp-oauth.html +3 -3
  36. package/dist/docs/guides/opentelemetry.html +3 -3
  37. package/dist/docs/guides/slack.html +3 -3
  38. package/dist/docs/guides/webhooks.html +3 -3
  39. package/dist/docs/hashmap.json +1 -1
  40. package/dist/docs/hillclimbing.html +3 -3
  41. package/dist/docs/index.html +3 -3
  42. package/dist/docs/quickstart.html +3 -3
  43. package/dist/docs/reference/agent-config.html +3 -3
  44. package/dist/docs/reference/artifacts.html +3 -3
  45. package/dist/docs/reference/channels.html +3 -3
  46. package/dist/docs/reference/cli.html +6 -4
  47. package/dist/docs/reference/connections.html +3 -3
  48. package/dist/docs/reference/hooks.html +3 -3
  49. package/dist/docs/reference/http-api.html +3 -3
  50. package/dist/docs/reference/instructions.html +3 -3
  51. package/dist/docs/reference/playground.html +3 -3
  52. package/dist/docs/reference/project-layout.html +3 -3
  53. package/dist/docs/reference/prompt.html +3 -3
  54. package/dist/docs/reference/schedules.html +3 -3
  55. package/dist/docs/reference/sessions.html +3 -3
  56. package/dist/docs/reference/skills.html +3 -3
  57. package/dist/docs/reference/subagents.html +3 -3
  58. package/dist/docs/reference/tools.html +3 -3
  59. package/dist/docs/scaffolding-agents.html +3 -3
  60. package/dist/docs/storage.html +3 -3
  61. package/dist/docs/templates/triage.html +14 -16
  62. package/dist/docs/troubleshooting.html +3 -3
  63. package/dist/internal/cli-ax.d.ts.map +1 -1
  64. package/dist/internal/cli-ax.js +10 -1
  65. package/dist/internal/cli-deploy.js +1 -1
  66. package/dist/internal/cli-slack.d.ts +2 -0
  67. package/dist/internal/cli-slack.d.ts.map +1 -1
  68. package/dist/internal/cli-slack.js +35 -18
  69. package/dist/internal/init-project.d.ts +3 -0
  70. package/dist/internal/init-project.d.ts.map +1 -1
  71. package/dist/internal/init-project.js +77 -45
  72. package/dist/internal/slack-provision-client.js +1 -1
  73. package/dist/playground/assets/{index-BHAPd9KT.js → index-0oqXUkrR.js} +44 -44
  74. package/dist/playground/assets/index-tHCjJxv4.css +1 -0
  75. package/dist/playground/index.html +2 -2
  76. package/docs/reference/cli.md +2 -0
  77. package/docs/templates/triage.md +59 -101
  78. package/package.json +1 -1
  79. package/src/channels/slack/manifest.ts +9 -3
  80. package/src/internal/cli-ax.ts +10 -1
  81. package/src/internal/cli-deploy.ts +2 -2
  82. package/src/internal/cli-slack.ts +57 -18
  83. package/src/internal/init-project.ts +93 -48
  84. package/src/internal/slack-provision-client.ts +1 -1
  85. package/templates/triage/README.md +27 -29
  86. package/templates/triage/agent/agent.ts +1 -0
  87. package/templates/triage/agent/channels/queue.ts +47 -0
  88. package/templates/triage/agent/channels/webhook.ts +50 -0
  89. package/templates/triage/agent/instructions.md +24 -13
  90. package/templates/triage/agent/lib/actuate.ts +759 -0
  91. package/templates/triage/agent/lib/parse-queue-event.ts +168 -0
  92. package/templates/triage/agent/lib/tracker.ts +5 -0
  93. package/templates/triage/agent/lib/types.ts +52 -0
  94. package/templates/triage/agent/lib/verify-webhook.ts +81 -0
  95. package/templates/triage/agent/skills/triage-rubric.md +6 -5
  96. package/templates/triage/agent/tools/record_triage.ts +24 -5
  97. package/templates/triage/evals/triage.eval.ts +25 -3
  98. package/templates/triage/overlays/jira/README.md +21 -0
  99. package/templates/triage/overlays/jira/agent/lib/tracker.ts +8 -0
  100. package/templates/triage/overlays/jira/agent/mcp-connections/tracker.ts +7 -0
  101. package/templates/triage/overlays/linear/README.md +21 -0
  102. package/templates/triage/overlays/linear/agent/lib/tracker.ts +8 -0
  103. package/templates/triage/overlays/linear/agent/mcp-connections/tracker.ts +7 -0
  104. package/templates/triage/package.json +1 -1
  105. package/dist/docs/assets/chunks/@localSearchIndexroot.C4uxzYEU.js +0 -1
  106. package/dist/docs/assets/templates_triage.md.CConZt1z.js +0 -11
  107. package/dist/docs/assets/templates_triage.md.CConZt1z.lean.js +0 -1
  108. package/dist/playground/assets/index-DpKH0HcT.css +0 -1
  109. package/templates/triage/agent/channels/intake.ts +0 -20
  110. package/templates/triage/agent/channels/slack.ts +0 -3
  111. /package/dist/docs/assets/{reference_cli.md.-V6J7Cl8.lean.js → reference_cli.md.D_CCfG8R.lean.js} +0 -0
@@ -467,7 +467,7 @@ function mapErrorResponse(
467
467
  );
468
468
  case 403:
469
469
  return new SlackProvisionApiError(
470
- `${serverError ?? "Not authorized"} Slack provisioning needs team membership and the cloud-agent entitlement on that team.`,
470
+ serverError ?? "Not authorized for this team",
471
471
  { status: 403 }
472
472
  );
473
473
  case 404: {
@@ -1,48 +1,46 @@
1
1
  # Triage agent
2
2
 
3
- A triage front door for your team. Send it bug reports, questions, and
4
- feedback; it classifies each report against a rubric, judges severity,
5
- records a structured verdict, and replies with the next step.
6
-
7
- Scaffolded with:
3
+ Comments on existing Linear or Jira issues. Classifies the ticket, writes
4
+ the next step, links a duplicate, and sets bug priority when the
5
+ connector can.
8
6
 
9
7
  ```bash
10
- npx @cursor/july init ./my-triage-agent --template triage
8
+ npx @cursor/july init ./my-triage-agent --template triage-linear
9
+ npx @cursor/july init ./my-triage-agent --template triage-jira
11
10
  ```
12
11
 
13
- ## Run it
12
+ ## Run
13
+
14
+ Connect the tracker in Cursor.
14
15
 
15
16
  ```bash
16
- agent-sdk login # once per machine
17
+ agent-sdk login
17
18
  agent-sdk dev
18
19
  ```
19
20
 
20
- Open the playground URL it prints. Chat directly, or use the `/report`
21
- slash command to submit a report the way an integration would
22
- (`POST /v1/channels/intake/report`).
21
+ In the playground, paste an issue identifier or run `/queue/issue`.
23
22
 
24
- ## Wire it to Slack
23
+ ```text
24
+ POST /<slug>/v1/channels/queue/issue
25
+ ```
25
26
 
26
- The Slack channel idles until its tokens exist. Create a Slack app and
27
- its env with:
27
+ Hosted Cursor aliases require `X-Agent-Alias-Token`. Linear and Jira
28
+ cannot send that header, so point create webhooks at a self-hosted
29
+ agent instead:
28
30
 
29
- ```bash
30
- agent-sdk slack setup
31
+ ```text
32
+ POST /<slug>/v1/channels/webhook
31
33
  ```
32
34
 
33
- Then @mention the bot or DM it. The setup-slack skill in the
34
- @cursor/july package has the full walkthrough.
35
+ Set `LINEAR_WEBHOOK_SECRET` or `JIRA_WEBHOOK_SECRET` to the signing
36
+ secret from the tracker. The identifier is the continuation key.
37
+ Questions and feedback get comments. A duplicate match gets a comment
38
+ on both issues. `agent-sdk eval` classifies and skips tracker writes.
35
39
 
36
- ## Make it yours
40
+ ## Files to edit
37
41
 
38
- - `agent/instructions.md` owns the flow every report follows.
39
- - `agent/skills/triage-rubric.md` owns the kinds, the tie-breakers, and
40
- the severity ladder. Edit this first; it is the judgment.
41
- - `agent/tools/record_triage.ts` owns the verdict shape. Point its
42
- `execute` at your tracker (Linear, GitHub Issues, a webhook) to file
43
- real tickets.
44
- - `evals/triage.eval.ts` holds three smoke cases. Run `agent-sdk eval`
45
- after every rubric change.
42
+ - `agent/skills/triage-rubric.md`: kinds, tie-breakers, severity
43
+ - `agent/instructions.md`: procedure around the rubric
44
+ - `evals/triage.eval.ts`: three smoke cases
46
45
 
47
- The full walkthrough, from scaffold through deploy, is the triage
48
- cookbook: run `agent-sdk docs` and open Templates, then Triage agent.
46
+ `agent/lib/actuate.ts` talks to the tracker. The connection is host-only.
@@ -8,6 +8,7 @@ export default defineAgent({
8
8
  { id: "fast", value: "true" },
9
9
  ],
10
10
  },
11
+ tools: ["read", "grep", "glob", "ls"],
11
12
  local: {
12
13
  sandbox: true,
13
14
  },
@@ -0,0 +1,47 @@
1
+ import { defineChannel, POST } from "@cursor/july/channels";
2
+ import { z } from "zod";
3
+ import {
4
+ formatQueuePrompt,
5
+ isTrackerWebhook,
6
+ parseQueueEvent,
7
+ } from "../lib/parse-queue-event.js";
8
+
9
+ export default defineChannel({
10
+ routes: [
11
+ POST("/issue", {
12
+ description: "Triage an existing tracker issue",
13
+ bodySchema: z.unknown(),
14
+ handler: async (_req, { send, waitUntil, body }) => {
15
+ const parsed = parseQueueEvent(body);
16
+ if (!parsed.ok) {
17
+ if ("ignored" in parsed) {
18
+ return Response.json({ ok: true, ignored: true });
19
+ }
20
+ return Response.json(
21
+ { ok: false, error: parsed.error },
22
+ { status: 400 }
23
+ );
24
+ }
25
+ const options = {
26
+ continuationToken: parsed.issue.identifier,
27
+ admission: "coalesce" as const,
28
+ ...(parsed.issue.title === "" ? {} : { title: parsed.issue.title }),
29
+ };
30
+ const prompt = formatQueuePrompt(parsed.issue);
31
+ if (isTrackerWebhook(body)) {
32
+ waitUntil(send(prompt, options));
33
+ return Response.json({
34
+ ok: true,
35
+ identifier: parsed.issue.identifier,
36
+ });
37
+ }
38
+ const session = await send(prompt, options);
39
+ return Response.json({
40
+ ok: true,
41
+ sessionId: session.id,
42
+ identifier: parsed.issue.identifier,
43
+ });
44
+ },
45
+ }),
46
+ ],
47
+ });
@@ -0,0 +1,50 @@
1
+ import { allowAll, defineChannel, POST } from "@cursor/july/channels";
2
+ import { z } from "zod";
3
+ import {
4
+ formatQueuePrompt,
5
+ parseQueueEvent,
6
+ } from "../lib/parse-queue-event.js";
7
+ import { verifyTrackerWebhook } from "../lib/verify-webhook.js";
8
+
9
+ export default defineChannel({
10
+ auth: [allowAll()],
11
+ routes: [
12
+ POST("/", {
13
+ description: "Signed Linear or Jira issue-created webhook",
14
+ bodySchema: z.unknown(),
15
+ handler: async (request, { send, waitUntil, body }) => {
16
+ const rawBody = await request.text();
17
+ const verified = verifyTrackerWebhook({
18
+ rawBody,
19
+ linearSignature: request.headers.get("linear-signature"),
20
+ hubSignature:
21
+ request.headers.get("x-hub-signature-256") ??
22
+ request.headers.get("x-hub-signature"),
23
+ linearSecret: process.env.LINEAR_WEBHOOK_SECRET,
24
+ jiraSecret: process.env.JIRA_WEBHOOK_SECRET,
25
+ nowMs: Date.now(),
26
+ });
27
+ if (!verified.ok) {
28
+ return Response.json({ ok: false }, { status: verified.status });
29
+ }
30
+ const parsed = parseQueueEvent(body);
31
+ if (!parsed.ok) {
32
+ return Response.json({ ok: true, ignored: true });
33
+ }
34
+ waitUntil(
35
+ send(formatQueuePrompt(parsed.issue), {
36
+ continuationToken: parsed.issue.identifier,
37
+ admission: "coalesce",
38
+ ...(parsed.issue.title === ""
39
+ ? {}
40
+ : { title: parsed.issue.title }),
41
+ })
42
+ );
43
+ return Response.json({
44
+ ok: true,
45
+ identifier: parsed.issue.identifier,
46
+ });
47
+ },
48
+ }),
49
+ ],
50
+ });
@@ -1,27 +1,38 @@
1
1
  # Triage agent
2
2
 
3
- You are the triage front door for this team. People send you reports:
4
- bug reports, questions, feedback, feature ideas. You classify each one,
5
- judge its severity, and hand back a verdict the team can act on.
3
+ You triage an existing Linear or Jira issue. The prompt includes its
4
+ identifier. Classify the issue, judge its severity, and record a verdict
5
+ that helps the team act on it.
6
6
 
7
7
  Read the `triage-rubric` skill before classifying. It defines the three
8
8
  kinds and the tie-breakers.
9
9
 
10
- ## Every report
10
+ ## Every issue
11
11
 
12
- 1. Read the report. If it is too thin to classify (no symptom, no
13
- question, no opinion), ask for the missing piece once. Otherwise do
14
- not ask; classify with what you have.
15
- 2. If a `memory/` directory exists in your workspace, grep the journal
16
- for similar past reports and say when one matches.
17
- 3. Call `record_triage` exactly once with your verdict.
18
- 4. Reply with the verdict: kind, severity, a one-line reason, and the
19
- next step. Keep the reply under six lines. No preamble.
12
+ 1. Read the identifier, title, description, URL, and reporter from the
13
+ prompt. Never invent missing fields.
14
+ 2. If the issue is too thin to classify, set `needsInfo` to true. Put the
15
+ exact missing detail in `nextStep`, then ask for it once in your reply.
16
+ Otherwise classify with what you have.
17
+ 3. If a `memory/` directory exists in your workspace, grep the journal
18
+ for similar issues. Set `duplicateOf` to the matching identifier when
19
+ the evidence is strong.
20
+ 4. Call `record_triage` exactly once. Pass the identifier from the
21
+ prompt with your verdict. The tool comments on the existing issue,
22
+ records duplicates, and sets bug priority when supported.
23
+ 5. Reply with the identifier, kind, severity, one-line reason, and next
24
+ step. If the tracker is not connected, tell the user to connect
25
+ Linear or Jira in Cursor. Keep the reply under eight lines. No
26
+ preamble.
20
27
 
21
28
  ## Boundaries
22
29
 
23
30
  - You classify and route. You do not fix bugs, write code, or promise
24
31
  timelines.
25
- - When a report mixes kinds, pick the dominant one and name the split
32
+ - You never create or file an issue. Native Slack @Cursor handles ticket
33
+ creation. This agent only enriches the issue in the prompt.
34
+ - Questions and feedback still go through `record_triage` so the issue
35
+ receives a comment.
36
+ - When an issue mixes kinds, pick the dominant one and name the split
26
37
  in your reason.
27
38
  - Never invent reporter details. Missing fields stay empty.